Dirty Butter Posted March 11, 2015 Share Posted March 11, 2015 The tabs in Foundation skin make the product code show up after I need it for a v5 mod to work with v6. I need {$PRODUCT.product_code} to be hidden above the BUY button in the Product Listing on the Storefront. How can I hide it? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 11, 2015 Author Share Posted March 11, 2015 Well I finally found there is already a hidden style in foundation.css. So I used: <span class=hide>{$PRODUCT.product_code}</span> BUT the little box with ONE in it next to the product code is still showing. And I've realized I need to know the Stock level, too. I do not use Options. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2015 Share Posted March 12, 2015 If you have kept the Product Information (Description) and Specifications (Additional Information) tabs, the stock level is on the Specs (Add'l Info) tab. And so is the Product Code. I don't know what your intentions are. Are you saying that you just need the product code and stock level to be in the HTML - addressable by a javascript selector of some sort - located ahead of the <button type="submit">? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 12, 2015 Author Share Posted March 12, 2015 It's not JavaScript - it's a decision tree that determines which email link my askabout mod provides to the customer, based on price of the item and whether or not it is in stock. In stock but below a certain price = Question about this item? In stock, but above a certain price = Make an Offer or Ask a question? Out of stock = Need help finding? To be useful, the link needs to be immediately visible - not in a tab. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2015 Share Posted March 12, 2015 Just off the top of my head - I haven't verified the correct syntax: For a logical decision:{assign $query_price=100.00}{* can be placed anywhere *} {if $PRODUCT.stock_level} {if $PRODUCT.price lt $query_price }QATI {else}MOAQ {/if} {else}NHF {/if} These variables are always available anywhere on the page, so no need to have them at a specific location, but hidden. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 12, 2015 Author Share Posted March 12, 2015 I wish I knew how to take your information and modify the code, but I don't. Here's what I pulled out of our v5 product page that creates the correct email link: {if isset($ASKABOUT_PRODUCT_URL)} {if $ASKABOUT_PRODUCT_OUT_OF_STOCK} <p><strong><a href="{$ASKABOUT_PRODUCT_URL}" title="{$LANG.askaboutaproduct.product_link_3}">{$LANG.askaboutaproduct.product_link_3}</a></strong></p> {else if !$ASKABOUT_PRODUCT_OUT_OF_STOCK && $ASKABOUT_PRODUCT_PRICING} <p><strong><a href="{$ASKABOUT_PRODUCT_URL}" title="{$LANG.askaboutaproduct.product_link_2}">{$LANG.askaboutaproduct.product_link_2}</a></strong></p> {else} <p><strong><a href="{$ASKABOUT_PRODUCT_URL}" title="{$LANG.askaboutaproduct.product_link}">{$LANG.askaboutaproduct.product_link}</a></strong></p> {/if} {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2015 Share Posted March 12, 2015 That would work. (I didn't realize the data for the decision tree was being generated by the plugin and the plugin then provides the logic switches.) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 12, 2015 Author Share Posted March 12, 2015 But I have that code in content.product.php now, and nothing shows. When I added the hidden product code above the Buy button, the Ask link showed up, with no decision about stock level or price. And the little box showed. I put the <span class=hide>{$PRODUCT.product_code}</span> back in so you could see what's happening. This one SHOULD be showing the Make an Offer email link, because of its price, but it doesn't. https://dirtybutter.com/plushcatalog/first-and-main-tan-angel-baby-bear-cream-wings.html And this one should be showing a Need Help Finding?email link, since it's out of stock, but it doesn't. https://dirtybutter.com/plushcatalog/dandee-collectors-choice-tan-bear-blue-jesus-loves-me-2011.html Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2015 Share Posted March 12, 2015 Since this is a live store, make the following edit, load the page in the browser, then remove the edit. At the bottom of the skin template content.product.php, add {debug}. When you call the page in the browser, there will be the Smarty Console popup. In the list of variables, find the various ASKABOUT variables. (The variables are listed in alphabetical order.) If there are no ASKABOUT variables in the Smarty Console, then the plugin isn't giving them to Smarty. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 12, 2015 Author Share Posted March 12, 2015 $ASKABOUT_PRODUCT_URL Smarty_Variable Object (3)->value = "https://dirtybutter.com/plushcatalog/..."->nocache = false->scope = "file:templates/content.product.php" $CANONICAL Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 12, 2015 Author Share Posted March 12, 2015 I decided to try moving the code section below the buy button, and I found I do NOT have to use any hidden code to get the Question about this lovie? email link. But I still can't get the other choices to work for Make an Offer and Out of Stock. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 12, 2015 Author Share Posted March 12, 2015 //NEW SEMPER FI ASKABOUT MAKE AN OFFER if ((bool)$getproduct[0]['use_stock_level'] && $getproduct[0]['stock_level'] <= 0) { $GLOBALS['smarty']->assign('ASKABOUT_PRODUCT_DESCRIPTION_3', true); } else if ($getproduct[0]['sale_price'] > 39) { $GLOBALS['smarty']->assign('ASKABOUT_PRODUCT_DESCRIPTION_2', true); } else if ($getproduct[0]['price'] > 39) { $GLOBALS['smarty']->assign('ASKABOUT_PRODUCT_DESCRIPTION_2', true); } //END SEMPER FI MAKE AN OFFER ASKABOUT $GLOBALS['smarty']->assign('ASKABOUT_PRODUCT_ID', $product_id); $GLOBALS['smarty']->assign('ASKABOUT_PRODUCT_NAME', $product_name); $GLOBALS['smarty']->assign('ASKABOUT_PRODUCT_CODE', $product_code); $GLOBALS['smarty']->assign('ASKABOUT_PRODUCT_DESCRIPTION', $product_description); $GLOBALS['smarty']->assign('ASKABOUT_DESCRIPTION', $askabout_description); $GLOBALS['smarty']->assign('ASKABOUT_STATUS', '1'); This is the part of cubecart.class.php that is not being processed. It was working in Blueprint. After this section it falls through to the Question about a lovie? email link that is showing in all 3 situations. It's looking more and more that I need to get help from Semper Fi. I thought it was something I could learn to fix with your help, but now I'm not so sure. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2015 Share Posted March 12, 2015 Was $ASKABOUT_PRODUCT_URL the only variable of the set that showed up in the Smarty Console? From the code above, I would expect to see six other ASKABOUT variables. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 12, 2015 Author Share Posted March 12, 2015 Yes, that's all that's showing in Smarty Console. I've contacted SemperFi. This was a special modification (to get the decision tree) of his normal Ask About mod. I have to assume that somewhere in porting over code from v5 to v6 I've messed something up, or there is a new code change needed somewhere that's not obvious. I appreciate your help as always. I can make do with the Question about this lovie? email link for now - now that I moved it so it will actually show. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.