| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Variants on the Productlist | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
Re: Variants on the Productlist
I just looked at the code, and wow, their implementation method is horrible. What they did was build a loop that runs through each product listed on the page. Then for each product, they include the Product Options and Wholesale modules.
The method of including per product is fine, when it's only 1 product. The way they've implemented means that they are running possibly 5+ additional queries per product. While this allows you to upgrade easily in the future (because they didn't make major changes to how Product Options works by default), this is one of the worse methods that you could implement regarding performance Typically, you would build such a modification so that you grab *all* product options for *all* products, in one query. so, instead of 75+ new queries (assuming 15 products per page), you would have a max of 1-3 new queries per page (1-3 because there might be an extra query or 2 to grab additional info for all those products) @Jonjolt: I still appreciate you posting this code, as this could be used as the basis for a better implementation, just wanted to make others aware of the performance cost and server strain this could cause. |
|||||||
#12
|
|||||||||
|
|||||||||
Re: Variants on the Productlist
No Jon, but it is the only line that contains the line you indicated:
if (!empty($product_options) && !empty($ There is no other line even close to the above line your reference.
__________________
Mary Lee ------------------- Dinner and a Murder Mystery Games http://www.dinnerandamurder.com x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template |
|||||||||
#13
|
|||||||
|
|||||||
Re: Variants on the Productlist
@2coolbaby: I didn't write this code, just FYI, I'm just a commenter
looks like the line you need to find is this: Code:
and add this before it: Code:
don't forget the rest of the changes. i think the patch file itself had an improper paste in it, fyi. |
|||||||
#14
|
|||||||||
|
|||||||||
Re: Variants on the Productlist
I now notice that your user ID's are different. Jon was your real name and the user ID of the one that posted it. I was confused. Sorry about that. Thanks for the help. The moment I made the customer_options changes, my products with variants went blank. I reverted back, as it seems like that may be way to easy to mess up your cart. I could spend all day installing it, only to find one piece of code that meses up my cart. I have the Altered Cart mod Download Expander, which gives me downloads for variants and I am afraid that might interfere.
__________________
Mary Lee ------------------- Dinner and a Murder Mystery Games http://www.dinnerandamurder.com x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template |
|||||||||
#15
|
|||||||
|
|||||||
Re: Variants on the Productlist
sounds like you might not have patched in the changes properly, as a blank page usually suggests an error in your TPL file. you could check your error logs to see what the error was, but it's not always a helpful message if you aren't used to coding
|
|||||||
#16
|
|||||||
|
|||||||
Re: Variants on the Productlist
I'm aware of the performance issues. I havn't had the time to modify the code myself
@intel352: That was excactly what I was going to do modification wise to the code to speed it up.
__________________
4.1.9 |
|||||||
#17
|
|||||||
|
|||||||
Re: Variants on the Productlist
Has anyone figured out how to do this with drop down menus?
__________________
www.easycoffee.com.au Version 4.1.9 |
|||||||
#18
|
|||||||
|
|||||||
Re: Variants on the Productlist
Heh looks like I figured it out thanks to the code provided here.
__________________
www.easycoffee.com.au Version 4.1.9 |
|||||||
#19
|
|||||||
|
|||||||
Re: Variants on the Productlist
Hey Chris... where on your site can I see an example of this?
__________________
Version 4.1.11 |
|||||||
#20
|
|||||||
|
|||||||
Re: Variants on the Productlist
i tried installing but it needs better directions after installing i get this on my pages
: Smarty error: unable to read resource: "modules/Product_Options/check_options_global.tpl" in /home/httpd/vhosts/toolexperts.com/httpdocs/Smarty-2.6.12/Smarty.class.php on line 1095
__________________
Tool Experts X-Cart DB Version: 4.1.12 GOLD |
|||||||
|
|||
X-Cart forums © 2001-2020
|