| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Product options in product list | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
Re: Product options in product list
I got it to "kind of" work. You have to hit the Add to Cart button, and then after like 5 seconds, it loads the product options. Anyone know how I can get the product options to be there when the page loads? http://www.medilogic-collective.com/xcart/indica/
When the page loads, the $product_options array isn't loaded. Thoughts?
__________________
Sunthing Productions Version 4.5 |
|||||||
#12
|
|||||||||
|
|||||||||
Re: Product options in product list
Okay here is step 1 to solving the problem in 4.4.X:
Open up /products.php and near line 135 insert this code: PHP Code:
PHP Code:
PHP Code:
This will get the options assigned to the product list in a category. Now you should be able to view the options in webmaster mode.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#13
|
|||||||||
|
|||||||||
Re: Product options in product list
Okay, now lets get our options to display in the template.
Edit /common_files/customer/main/buy_now.tpl Near line 54: After: PHP Code:
PHP Code:
Before: PHP Code:
Please note you will need to have the Buy Now buttons enabled in the admin. Also if this change throws off your template, try replacing the <div class="quantity"> and the </div> with table tags. So the added code would read: PHP Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#14
|
|||||||||
|
|||||||||
Re: Product options in product list
When testing this, my client and I discovered that the product options disappeared once the add to cart button was pressed.
To fix this, edit /include/func/func.ajax.php: Around line 105, After: PHP Code:
Insert: PHP Code:
PHP Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#15
|
|||||||||
|
|||||||||
Re: Product options in product list
Going even further, here is how to modify the javascript to get the product price to update when the product option is changed. //This will not work with product variants, or with wholesale prices
We begin by submitting the product id with the onchange event: In /my_skin/modules/Product_Options/customer_options.tpl near line 48: Replace: PHP Code:
PHP Code:
Next before we dive into the JS, lets set the span ID to include the productid on the product page: In /customer/main/product_details.tpl near line 80: After: PHP Code:
PHP Code:
Replace: PHP Code:
PHP Code:
Note: the below code references the product price in the template products_list.tpl, you may be using products_t.tpl instead, if your products are arranged in multiple columns. This depends on the settings under General Settings/Appearance - Displaying products. In this case, look near line 116 and make the edit to the span as described below, and include the capture above it. And on the category page: In /customer/main/products_list.tpl near line 70: After: PHP Code:
PHP Code:
Replace: PHP Code:
PHP Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#16
|
|||||||||
|
|||||||||
Re: Product options in product list
Here is where things get a bit tricky.
Let's start modifying the product options Javascript. In /modules/Product_Options/check_options.tpl near line 27: Before: PHP Code:
PHP Code:
Then, near line 76: After: PHP Code:
PHP Code:
PHP Code:
Next, near line 159: Replace: PHP Code:
PHP Code:
I have attached the whole file with the edits just in case.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#17
|
|||||||||
|
|||||||||
Re: Product options in product list
Now we dive into the actual script itself, lot of edits to make here.
In /my_skin/modules/Product_Options/func.js near line 21: After: PHP Code:
PHP Code:
PHP Code:
Next, near line 35: After: PHP Code:
PHP Code:
Next, near line 162: After: PHP Code:
PHP Code:
PHP Code:
Next, near line 198: After: PHP Code:
PHP Code:
PHP Code:
Then, near line 315: After: PHP Code:
PHP Code:
PHP Code:
Well that's it! Hope it has been enlightening and entertaining. Remember this is just a quick little hack, it will not work in all instances, and there are certainly better ways to do this if you spent more time investigating it than I have. But it should get you started towards a more robust solution if that is your intention. I have again uploaded the whole func.js file just in case I missed something. I renamed it to func.tpl so the forum would accept it.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#18
|
|||||||||
|
|||||||||
Re: Product options in product list
Does this work for variants?
__________________
Richard Ultimate 5.4 testing |
|||||||||
#19
|
|||||||||
|
|||||||||
Re: Product options in product list
Any way we can use this code to show product options in new arrivals & on sale module product lists?
__________________
Marcello Canitano New Site: X-Cart v4.5.5 GOLD X-Cart Mobile v1.4.3 X-Payments v1.0.6 CDSEO Pro v2 Total Server Solutions xCDN www.silverhorseracing.com |
|||||||||
#20
|
|||||||||
|
|||||||||
Re: Product options in product list
@Richard,
I'm not really sure! I'd have to test it. Sorry for the 2 year late reply. @Marcello, I don't see why not. This code is pretty old now, I haven't used it again or tested in several years. I'm sure that large portions of it still apply, but it would need to be tested along the way as you were implemented, not just blindly followed. It should point you in the right direction at least!
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|