Dirty Butter Posted July 26, 2016 Share Posted July 26, 2016 We show all our product listings, whether they are in stock or not, because part of our purpose is as a ministry to help people FIND lovies. Leaving our sold items online gives people information about brand, description, etc. that is very useful to them. And we're setup to help them find what they need. That means we need Google to provide our sold items in search results. (I DO leave them out of Google Adwords) Google balks if there is not accurate pricing. 1. Regular Price wrongly shows Price twice https://dirtybutter.com/plushcatalog/walmart-brown-white-beagle-dog-holding-red-xoxo-heart.html 2. Sale Price with Regular Price showing as well WORKS https://dirtybutter.com/plushcatalog/carters-6990-white-polka-dot-blue-dog-with-green-ears-feet-no-sound.html 3. Sold, showing REGULAR price . Does not show the Sale price I would like to have showing https://dirtybutter.com/plushcatalog/springs-global-pink-flat-head-rabbit-velour-blankie.html I've attempted a series of if/else statements to make this work, but I've messed up the nesting logic in some way. {if ($CTRL_ALLOW_PURCHASE) && (!$CATALOGUE_MODE)} {if ($PRODUCT.ctrl_sale) && ($PRODUCT.stock_level != '0')} <td>Sale Price</td> <td> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="price" content="{$PRODUCT.price_to_pay}"{* Example: 10.99 *} /> <span>{$PRODUCT.sale_price}</span> </div> </td> {else} <td>Regular Price</td> <td> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="price" content="{$PRODUCT.full_base_price}"{* Example: 14.99 *} /> <span>{$PRODUCT.price}</span> </div> </td> {/if} </tr> {/if} {if ($PRODUCT.ctrl_sale) && ($PRODUCT.stock_level == '0')} <tr> <td>Sold for </td> <td> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="price" content="{$PRODUCT.price_to_pay}"{* Example: 10.99 *} /> <span>{$PRODUCT.sale_price}</span> </div> </td> {else} <td>Regular Price</td> <td> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="price" content="{$PRODUCT.full_base_price}"{* Example: 14.99 *} /> <span>{$PRODUCT.price}</span> </div> </td> {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 26, 2016 Share Posted July 26, 2016 Based on what I assume you are trying to do, I see some table tags and some {if} structure gone awray. The first line {if} and the last line {/if} are OK. Then, starting with the second line, the {if}, {else}, {/if} sections are OK. But then you break the table row structure with: </tr> {/if} {if ($PRODUCT.ctrl_sale) && ($PRODUCT.stock_level == '0')} <tr> I think simply: {if ($PRODUCT.ctrl_sale) && ($PRODUCT.stock_level == '0')} to start an alternate pair of cells when out of stock, followed by a missing closing {/if} at the next to last line. Also, considering the Regular Price is the same for both in and out of stock, it need not be tested. But let's review the logic: You want a price to show: Regular (and Sale if appr.) You want one of two phrases to show: Regular or Sold (and Sale if appr.) + Stock: Regular (and Sale) 0 Stock: Sold (and Sale) {if ($CTRL_ALLOW_PURCHASE) && (!$CATALOGUE_MODE)} {if ($PRODUCT.ctrl_sale)} <tr>{* Only show this row when item is on sale - regardless of stock *} <td>Sale Price</td> <td> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="price" content="{$PRODUCT.price_to_pay}"{* Example: 10.99 *} /> <span>{$PRODUCT.sale_price}</span> </div> </td> </tr> {/if} <tr>{* Always show this row *} {if ($PRODUCT.stock_level gt 0)}{* In stock *} <td>Regular Price</td> {else}{* Not in stock *} <td>Sold for </td> {/if} <td> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="price" content="{$PRODUCT.full_base_price}"{* Example: 14.99 *} /> <span>{$PRODUCT.price}</span> </div> </td> </tr> {/if} Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 26, 2016 Author Share Posted July 26, 2016 I understand how you set it up, but the price is not showing on the Sold one. https://dirtybutter.com/plushcatalog/animal-adventure-large-lying-down-fur-monkey-camo-bow.html I originally did not put a price on the Sold ones, but Google had a hissyfit! Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 26, 2016 Share Posted July 26, 2016 The over-all table structure isn't right. In content.product.php: <tr> <td>{$LANG.catalogue.stock_level}</td> <td>{$PRODUCT.stock_level}</td> <tr> {if ($CTRL_ALLOW_PURCHASE) && (!$CATALOGUE_MODE)} Change to: <tr> <td>{$LANG.catalogue.stock_level}</td> <td>{$PRODUCT.stock_level}</td> </tr> {if ($CTRL_ALLOW_PURCHASE) && (!$CATALOGUE_MODE)} Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 27, 2016 Author Share Posted July 27, 2016 I had to change {if ($CTRL_ALLOW_PURCHASE) && (!$CATALOGUE_MODE)} to {if (!$CATALOGUE_MODE)} to get it to work for Sold items, but that works for me! THANK YOU Bsmither!!! I can always count on you to help with my messes!! 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.