| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
help with if then statment for detailed description | ||||
|
|
Thread Tools | Search this Thread |
#31
|
|||||||
|
|||||||
Re: help with if then statment for detailed description
HI GB
Thanks for the reply I believe I am using the POS#'s from the category section I made in the ADMIN section. I tried both $cat_order_by variable instead of the $c.order_by variable and get the same results. ( I just PM you a link to the page I am trying to add the button to- it is on a test server so you may need to log in to get to the page ) In the mean time this is what I currently have in the product.php $main = "product"; $smarty->assign("main",$main); $cat_order_by = func_query_first_cell("select order_by from $sql_tbl[categories] where categoryid = '$cat'"); $smarty->assign("cat_order_by",$cat_order_by); and to the product.tpl <td valign="top" width="100%"> <span>{if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{ /if}</span> {if $cat.order_by gt 4 and $cat.order_by lt 41} {include file="buttons/sizing_help.tpl"}{/if} As I look at this now I am wondering of this is not working because the statement I have written is not correct ( incomplete) THanks to all for the help Best Scott V
__________________
scott v x cart version 4.1.8 (Unix) |
|||||||
#32
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
Adapting previous code slightly, here's how I would do do it.
In product.php FIND: $smarty->assign("product",$product_info); BEFORE add: Code:
In product.tpl Code:
|
|||||||||
#33
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
Hi Scott -
If you are using the code that I posted - then the if/than statement you posted is wrong - I did not put the order_by into an array called cat - so instead of {if $cat.order_by gt 4 and $cat.order_by lt 41} use {if $cat_order_by gt 4 and $cat_order_by lt 41} If it still does not work - try Jon's code. It should work as well. If you still have issues - post again - and I can offer more suggestions for how to debug - by checking the smarty variables.
__________________
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) |
|||||||||
#34
|
|||||||
|
|||||||
Re: help with if then statment for detailed description
gb2. Ashley, Jon, Vetrivel, and any others that I have missed here,
Thanks much for all the help you have given me here. I finally go this to work, and it seems to be perfect. The cat pages are calling perfectly and the button I made only appears on the pages that I have indicated by POS in the if then statement. There is no way I would have ever been able to figure this out myself with out the help of you guys. Once again these forums have been my godsend. Many , many thanks again to all you. I really appreciate your help. As I think there are others here that may benefit from this I am going to post the code for how to add a button and call your category pages in the product.tpl to the mod section, with hopes that this helps someone else. Best Scott V aka fotodog13
__________________
scott v x cart version 4.1.8 (Unix) |
|||||||
#35
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
Quote:
__________________
MercuryMinds Technologies Development Team, Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com X-Cart Mailchimp Ecommerce 360 Plugin/integration module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) Smasher, a smart search engine for x-cart store (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) One Page Checkout (OPC) - X-Cart module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) |
|||||||||
#36
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
well I really didn't help much just did some learning. would you post the final solution please? Interested to see what worked.
__________________
xcart 5.1.2 |
|||||||||
#37
|
|||||||
|
|||||||
Re: help with if then statment for detailed description
HI Ashley,
Don't kid yourself you were a big help to me. I just pasted the code and solution in the completed mods section. "how to add a button to the detailed description box" I am using this for a site that sells dog accessories. One of the things they sell are dog coats. The owner has a lot of returns due to measuring the dog incorrectly. To solve this problem they made an embedded page and that tells how to measure their dog to get the correct fit. The previous person working on this site then added a button that appeared on every page of the site . Whether you were buying a dog toy, or t shirt the button appeared that took you to the how to measure your dog for the dog coat page. Obviously this was not a good solution because if someone was buying something other than a dog coat there was really no need for the button to be there. Adding this page lets the button appear only on the pages that have been assigned by the POS set in the category admin section. I know I could of added a link to each particular page manually but that would be a pain in the but. I also saw scripts that allowed something like this to happen through the use of a pop up but was not sure that was a good solution here. ( then I would have to ask the potential customer to enable pop ups which they may or may not know how to do) Anyway this works like a charm. This site is under construction on a private ( closed ) server right now. If you want to see how it works I can PM you a link with a user name and password to see it Hope you find this useful too. Best Scott V aka fotodog13
__________________
scott v x cart version 4.1.8 (Unix) |
|||||||
#38
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
Glad it worked for you, Scott. I looked at the page and it is a good improvement over the current site. It was also thoughtful of you to post it as a completed mod to save others time from wading through our discussions!
__________________
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
|