View Single Post
  #6  
Old 03-18-2010, 10:47 AM
  PC Doctor's Avatar 
PC Doctor PC Doctor is offline
 

Advanced Member
  
Join Date: Apr 2003
Location: Cincinnati, OH USA
Posts: 38
 

Default Re: Select Options (Variants) Redirect Button Mod for X-Cart v4.3.0

I dug a little deeper into this mod and found out that apparently there are two types of product options - product variants and product options. Why they do it this way I do not know but this may be a partial reason if you have problems getting this mod to work.

When you add a product option, there are three 'Option Group Types' called 'Price Modifier', 'Product Variant' and 'Custom Text Field'. Price Modifier and Custom Text Field are both considered product options, and Product Variant is considered a product variant. I changed my options from 'Product Variant' to 'Price Modifier' and thats when I realized my mod wasn't working completely right. There's a couple reasons I changed the option type, one because X-cart says it's better to use Price Modifier instead of Product Variant if possible because Product Variant takes longer to process and is harder on the server. And two I just didn't like the way Xcart stores Product Variants, it seems very confusing and over complicated, probably why it's so much harder on the server. I changed to Price Modifier but simply didn't code it to change any price so in essence it's still just a variant.

I will update the code above, but using the original code:
Code:
{if $product.variantid}
will only detect product variants (if you select 'Product Variant' as the 'Option Group Type'). But then the custom 'Select Options' button would not display if your product option was set as a Price Modifier or Custom Text Field.

I found out using webmaster mode there are a couple ways to detect if there are product options or variants. To detect options, use $product.is_product_options and to detect variants use either $product.variantid or $product.is_variants so here is the update to this select button mod (I will update the original post as well - 3/18/2010)

Change:
Code:
{if $product.variantid}
To:
Code:
{if $product.variantid || $product.is_product_options}
Do this in both places above.

This will now allow any product you have that has any type of option to show a 'Select Options' black button and directly above it say 'Starting from: $xx.xx', instead of the usual price in the black button. Hope this helps!
__________________
PS3 EZ Chill - Internal Cooling Fan Mod Kit
Overheating/YLOD Prevention for Your Playstation 3
www.PS3ezChill.com

Fix-My-PC-Doctor
PC and Game Repair Services
www.FixMyPCDoctor.com
X-Cart 4.3.2
Reply With Quote