| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
ship by mail icon.. (like the special offer icon) (i can pay for it) | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
if extra field eq "Y" show an image .. please help
Hello there, i need a custom mod, basically i don't know if it needs too much work. If it doesn't, and someone can guide me it would be great. If it needs too much work and someone can do it, i can pay for it.
Basically i need two things. i want to add an option on the page that you create the products. That option should ask "Ship by mail" and it will have the option yes and no. The only function that i want to have, is : if i select yes, i want automatically to add a small icon down of the product picture (that icon will say "ship by email").. like the way the "special offer" icon appears, but not up to the picture, i want the icon to appear down of the picture.. for sure i want that icon to appear on product description page, but if it is possible to appear also while browsing the category, it would be nice..
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql) Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server Modules : X-Offer & X-Aom & One page checkout Product tabs & Product downloads & many more |
|||||||
#2
|
|||||||||
|
|||||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
You should be able to use extra fields to do this.
You can read about setting extra fields in the manual. You can create an extra field to use to store the "Set by Mail" variable for each product. (You will have to do a bit of a mod to get it to do a radial or pull down to set the "Y" or "N" - or you can just enter the "Y" into the default text-box that xcart sets up for you.) There are several posts on the forum describing how to retrieve the extra fields into your templates. You could start with this thread - it helps explain how to get the variable and do if/than based on the setting. You can read the value of the extra fleld you make on the category page and the product page. You can do an if/than to display the icon when it is set to "Y"
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#3
|
|||||||
|
|||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
ok i'll start reading. thank you for pointing me on the right place
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql) Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server Modules : X-Offer & X-Aom & One page checkout Product tabs & Product downloads & many more |
|||||||
#4
|
|||||||
|
|||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
and what code should i use to show the image on the product.tpl? This i have bellow? I am not familiar..
my extra field service name is "ship_by_mail" {if $extra_fields[field].ship_by_mail eq "Y"} <img src="/skin1/images/myimage.gif" />{/if} or {if $extra_field.service_name eq "ship_by_mail"} {if $extra_field.value eq "Y"} <img src="skin1/images/custom/ship_by_mail.gif" />{/if}{/if} none of those workings
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql) Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server Modules : X-Offer & X-Aom & One page checkout Product tabs & Product downloads & many more |
|||||||
#5
|
|||||||||
|
|||||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
Hi Christopher -
Look at posts #6 & #7 in this thread. Since you can have more than one extra field - they are stored in an array that you have to loop trough to get yours. In the examples - replace "Ingredients" with the name of your field "ship_by_mail". Quote:
Code:
Code:
Code:
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#6
|
|||||||
|
|||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
this code have to be also in the product.tpl?
{section name=field loop=$extra_fields} {if $extra_fields[field].field eq "ship_by_mail" && $extra_fields[field].field_value ne ""} {assign var="ship_by_mail" value=$extra_fields[field].field_value} {/if} {/section} i tried it but i think don't work. the image doesn't appear. I tried also the <b>Ship By Mail:</b> {$ship_by_mail}<br /> but it appears only the text with bold
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql) Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server Modules : X-Offer & X-Aom & One page checkout Product tabs & Product downloads & many more |
|||||||
#7
|
|||||||||
|
|||||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
yes - the loop must also be in the product.tpl - to debug, you can add something that writes out the variables inside the loop to make sure it is working and that the variables are as you expect.
{section name=field loop=$extra_fields} <b>field</b>: {$extra_fields[field].field}<br /> <b>value</b>: {$extra_fields[field].field_value}<br /> {if $extra_fields[field].field eq "ship_by_mail" && $extra_fields[field].field_value ne ""} {assign var="ship_by_mail" value=$extra_fields[field].field_value} <b>Ship By Mail:</b> {$ship_by_mail}<br /> {/if} {/section}
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#8
|
|||||||
|
|||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
Quote:
from that code it appears that : field: Ship by mail value: Y but not the <b>Ship By Mail:</b> {$ship_by_mail}<br />
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql) Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server Modules : X-Offer & X-Aom & One page checkout Product tabs & Product downloads & many more |
|||||||
#9
|
|||||||
|
|||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
well the one that worked is that :
Code:
so it looks like on the "$extra_fields[field].field" it wants the field name and not service name thank you very much
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql) Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server Modules : X-Offer & X-Aom & One page checkout Product tabs & Product downloads & many more |
|||||||
#10
|
|||||||||
|
|||||||||
Re: ship by mail icon.. (like the special offer icon) (i can pay for it)
Yes - the code I gave you will work if you replace "ship_by_mail" in the smarty comparisons with "Ship by mail"
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
|
|||
X-Cart forums © 2001-2020
|