Jump to content

How to hide Product Code?


Recommended Posts

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.

Link to comment
Share on other sites

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">?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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}
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

//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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...