| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Product options on products.tpl | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
Hey, thanks for figuring out the array index I needed. Let me know if you figure out the price modification code or if you see any other flaws in my code. I may be generating more dynamic javascript functions than are necessarry to make the options work...haven't yet tried to optimize the code in any way.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#12
|
|||||||
|
|||||||
Price changing
Minorgod,
The price modification is working for me with the code that you gave me. I haven't made any changes besides the array change. I am however using a different products.tpl file than you. I don't think this would really affect anything. I can post my code if you want. Just let me know. Marty |
|||||||
#13
|
|||||||||
|
|||||||||
Sweet...I hadn't even tried using the price modification part of the product options, but that actually makes sense now that I think about it, since the original product options code is what still gets run by all the other areas of the site. Since the prices on the products.tpl output aren't javascript-accessible in their current form, it would be a serious pain in the ass to have to modify the price display directly on the products.tpl page based on what options are chosen. Anyway, this makes me happy. Thanks for the info!
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#14
|
|||||||
|
|||||||
Thanks for working with me too!
I appreciate the collaboration! |
|||||||
#15
|
|||||||||
|
|||||||||
updated products.php page...
Below is an update to my modified customer/products.php page for displaying options on the products.tpl page.
Code:
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#16
|
|||||||||
|
|||||||||
Possibly a faster way to do this...
After I created the mod above, I noticed that my site was running slower and I suspected it was because the code above was looping through the products and doing a separate query for each product options and then lopping through the products again and doing a separate query for each product javascript options.
I rewrote the script so that it only does two queries, one to get all the options, and one to get all the javascript. I then loop through the products and and options and javascripts to associate the proper options and javascript with each product without doing any more MySQL queries. In the end, I'm not sure if this way is faster since I'm now forced to loop through all the options for each product to associate them, and then loop through all the javascripts for each product to associate the correct javascript with each product. So ultimately, there's a lot more loops happening and I can't tell if I've made it faster or not. At any rate, here's the code...it still works with the modified templates posted above. Code:
If anyone knows if this is faster than the previous method, let me know please. Thanks...and...uh...you're welcome.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#17
|
|||||||||
|
|||||||||
Thanks Brett
If you do any more optimization, can you please keep this thread updated. Appreciated. |
|||||||||
#18
|
|||||||||
|
|||||||||
How can we add options to the featured products page?
|
|||||||||
#19
|
|||||||||
|
|||||||||
Can't you just use the above example? I haven't looked at it yet, but I'll need to modify my featured products page at some point. If I do the modifications I'll post them here.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#20
|
|||||||||
|
|||||||||
I used the code above, but it didn't work for the featured products.
|
|||||||||
|
|||
X-Cart forums © 2001-2020
|