| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
If statement for specific option class? | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
If statement for specific option class?
Here's a tricky one - have a client who we are displaying the price on the category page with 'Starting at' in front of it for products with options using this:
{if $products[product].is_product_options} However, he would only like this to display for products that are variants with a specific option class - in this case 'size'. So products that have an option with the class of 'size' will show 'starting at' while products that have an option class of 'flavor' will not. Version 4.1.10. Any ideas?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#2
|
|||||||||
|
|||||||||
Re: If statement for specific option class?
It's quite simple
find in your skin1/customer/main/product.tpl Code:
Code:
__________________
Regards, Victor Dubiniuk X-Cart Skins Store - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: If statement for specific option class?
Sorry I have missed that you need this in category.
add in your products.php before the line Code:
this: Code:
and every product from your $products array will contain additional array with product options so you just need to edit skin1/customer/main/products.tpl and skin1/customer/main/products_t.tpl as it was figured in my previous post
__________________
Regards, Victor Dubiniuk X-Cart Skins Store - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
#4
|
|||||||
|
|||||||
Re: If statement for specific option class?
No luck with that Victor. There's an extra & in your php (before $pp) but even removing that doesn't do anything. Any other ideas?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||||
|
|||||||||
Re: If statement for specific option class?
This & is necessary to pass the element of array by reference so it should present because $products array won't be modified without it.
But I have found another bug (error message for the categories with no products in it) so try with Code:
and Code:
__________________
Regards, Victor Dubiniuk X-Cart Skins Store - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
#6
|
|||||||
|
|||||||
Re: If statement for specific option class?
Well that causes a smarty error
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#7
|
|||||||
|
|||||||
Re: If statement for specific option class?
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /public_html/new/products.php on line 106
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#8
|
|||||||
|
|||||||
Re: If statement for specific option class?
Try this php:
PHP Code:
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#9
|
|||||||
|
|||||||
Re: If statement for specific option class?
Thanks Ralph - no smarty error from that, but no 'starting at' showing either. Other ideas?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#10
|
|||||||||
|
|||||||||
Re: If statement for specific option class?
http://www.phpbuilder.com/manual/en/language.references.pass.php
also I should mention that this is working for me
__________________
Regards, Victor Dubiniuk X-Cart Skins Store - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
|
|||
X-Cart forums © 2001-2020
|