jboras Posted June 17, 2014 Share Posted June 17, 2014 Does anyone know where we can make a change to show "Call" or something else where the price for an item is $0.00 We sometimes leave the price on $0.00 when prices fluctuate too much on a product. It would be a neat way to tell our customers to call for latest price rather than have a $0.00 display There is a message that comes up (beneath the retail price) when there are Bulk Discounts on an item I wonder if that could be use to display an alternate message (Call for latest price) when the price is equal to $0.00? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17, 2014 Share Posted June 17, 2014 This may of help: http://www.cubecartforums.org/index.php?showtopic=17206 It's possible it may need a tweak to work with the latest versions of CC5. Quote Link to comment Share on other sites More sharing options...
jboras Posted June 17, 2014 Author Share Posted June 17, 2014 Thanks bsmither I tried that but it blanks out the entire price line it neither shows $0.00 or $TEXT Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17, 2014 Share Posted June 17, 2014 I'll look at it shortly. Quote Link to comment Share on other sites More sharing options...
jboras Posted June 17, 2014 Author Share Posted June 17, 2014 I think I have found out why but don't know how to fix... (not php literate) If you use text like "FREE" it works; if we use "$Call" which is a sort of standard we use to tell our customer to call for latest price it blanks every think out. (on the price line) How can we get the $ sign there without php interpreting it as a string or whatever it's doing? ie to show "$Call" Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17, 2014 Share Posted June 17, 2014 "It would be a neat way to tell our customers to call for latest price rather than have a $0.00 display." Please answer this for us: How do you prevent a customer from purchasing an item at $0.00? I have in mind to edit the skin. We can adjust the template variables to be {$product.price_unformatted|default:'$CALL!'} If the unformatted price (new to a recent version) is empty, then instead say $CALL! Empty includes strings that look like zero values. Quote Link to comment Share on other sites More sharing options...
jboras Posted June 17, 2014 Author Share Posted June 17, 2014 We don't want to stop them. Quite the opposite. We want to receive orders with $0.00 or $Call comment we then know the customers requires us to quote them for a product. This is an understanding we have in place with our customers that we This would have to be used exclusively for the Retail Price, or Bulk Prices. If it was used across the board it would show up $Call! in strange areas like Product Options that are $0.00 or no charge In this instance: $product['price'] = "$Call"; what is the format so that $Call is not seen as a string? (Please) Quote Link to comment Share on other sites More sharing options...
jboras Posted June 17, 2014 Author Share Posted June 17, 2014 I think the better option would be in content.product.php currently: {if $PRODUCT.ctrl_sale} <h1><span class="price_previous">{$PRODUCT.price}</span> <span class="price_sale">{$PRODUCT.sale_price}</span></h1> {else} <h1>{$PRODUCT.price}</h1> {/if} should do a check like: {if $PRODUCT.ctrl_sale} <h1><span class="price_previous">{$PRODUCT.price}</span> <span class="price_sale">{$PRODUCT.sale_price}</span></h1> {else} {if $PRODUCT.price = $0.00} *** Not correct syntax as I don't know PhP <h1>$Call!</h1>" else <h1>{$PRODUCT.price}</h1> This was only $0.00 amounts will see the Call... message. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17, 2014 Share Posted June 17, 2014 {else} {if empty($PRODUCT.price_unformatted)}<h1 style="color:red;">$CALL!</h1>{else}<h1>{$PRODUCT.price}</h1>{/if} {/if} You won't see $CALL! anywhere except when viewing the Product Details page, as this is a solution that affects the display of the price only. CubeCart always internalizes the product's price. This allows CubeCart to display a store in multiple currencies - while always knowing the true prices using the store's default currency, the currency generally used by the payment processor. Quote Link to comment Share on other sites More sharing options...
jboras Posted June 17, 2014 Author Share Posted June 17, 2014 Thank you, I tried but for some reason it's not working. You don't need to waste any more time on it. We can live with $0.00 The code was put into: skin/templates/content.product.php as: <h2>{$PRODUCT.name}</h2> <form action="{$VAL_SELF}" method="post" class="addForm"> <div style="overflow:hidden;"> <div id="product_detail"> {if $PRODUCT.ctrl_sale} <h1><span class="price_previous">{$PRODUCT.price}</span> <span class="price_sale">{$PRODUCT.sale_price}</span></h1> {else} {if empty($PRODUCT.price_unformatted)} <h1 style="color:red;">$CALL!</h1> {else}<h1>{$PRODUCT.price}</h1> {/if} {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17, 2014 Share Posted June 17, 2014 When editing skin templates, it may be required to clear the cache. In admin, Maintenance, Rebuild tab, check the cache box and click Submit. Quote Link to comment Share on other sites More sharing options...
jboras Posted June 17, 2014 Author Share Posted June 17, 2014 Still no good (after Maintenance; for some reason the first part of the (if....) logic; it is not picking 0.00 and is just doing the (else...) part of the command, but certainly is the correct place to put a little message that does not impact calculations or anything else in cubecart. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17, 2014 Share Posted June 17, 2014 In the template file, content.product.php, at the very end, add this: {debug} This will provide the browser with a popup window that give the values of all the template variables. Scroll to the PRODUCT variable and determine the value for the array element 'price_unformatted'. (Yes, all your customers will see this as well. So, either put your store offline while you do this, or immediately remove the {debug} once you have the popup.) Quote Link to comment Share on other sites More sharing options...
jboras Posted June 18, 2014 Author Share Posted June 18, 2014 This is what I see in the debug pop up window: ngine with 20KW ..." price_unformatted => "0.00" sale_price_unformatted => "0.00" ctrl_purchase => true out => false On the product page the price is $0.00 The code as it currently sits <div id="product_detail"> {if $PRODUCT.ctrl_sale} <h1><span class="price_previous">{$PRODUCT.price}</span> <span class="price_sale">{$PRODUCT.sale_price}</span></h1> {else} {if empty($PRODUCT.price_unformatted)}<h1 style="color:red;">$CALL!</h1>{else}<h1>{$PRODUCT.price}</h1>{/if} {/if} {if isset($PRODUCT.discounts)} <p class="bulk_discount">(<a href="#quantity_discounts">{$LANG.catalogue.bulk_discount}</a>)</p> {else} <p class="bulk_discount">(contact us for bulk volume discounts)</p> {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18, 2014 Share Posted June 18, 2014 Let's assume that PHP's empty() does not include the string 0.00 (it does include 0.0). So, we will try not testing for empty90, but specifically for anything that looks like zero. {if $PRODUCT.price_unformatted==0}<h1 style="color:red;">$CALL!</h1>{else}<h1>{$PRODUCT.price}</h1>{/if} The == is PHP's "looks like" equivalence test. False, null, integer 0, double 0.00, string 0.0000000 all "looks like" zero. Quote Link to comment Share on other sites More sharing options...
jboras Posted June 18, 2014 Author Share Posted June 18, 2014 That's it you've hit the nail on the head!! Thank you! Quote Link to comment Share on other sites More sharing options...
jboras Posted June 18, 2014 Author Share Posted June 18, 2014 Substituting the same in content.category.php works as well Quote Link to comment Share on other sites More sharing options...
jboras Posted June 18, 2014 Author Share Posted June 18, 2014 Take that back... it does not work for category view... not a problem Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18, 2014 Share Posted June 18, 2014 Put {debug} at the end of the template content.category,php and see what array elements are available for $PRODUCT (which gets iterated onto $product). Quote Link to comment Share on other sites More sharing options...
jboras Posted June 18, 2014 Author Share Posted June 18, 2014 in the product view it also creates another issue: When viewing a product; clicking the links to go back to the previous category > sub category etc..., it takes you straight back to the Homepage for some reason. Removing the modified line and going back to original line the navigation tabs work ok Quote Link to comment Share on other sites More sharing options...
jboras Posted June 18, 2014 Author Share Posted June 18, 2014 In category the sale price value shows as : $PRODUCTS Smarty_Variable Object (3)->value = Array (26) 0 => Array (64) product_id => "157" product_code => "BQ336" quantity => "1" description => "<table border="0" cellpadding="0" cel..." price => "US$0.00" name => "BQ336 Ice Cream Machine" cat_id => "5" popularity => "15" sale_price => "US$0.00" cost_price => "0.00" stock_level => "0" use_stock_level => "1" In product view it shows as: $PRODUCT Smarty_Variable Object (3)->value = Array (65) product_id => "157" product_code => "BQ336" quantity => "1" description => "<table border="0" cellpadding="0" cel..." price => "US$0.00" name => "BQ336 Ice Cream Machine" cat_id => "5" popularity => "15" sale_price => "US$0.00" cost_price => "0.00" stock_level => false use_stock_level => "1" digital => "0" digital_path => "" product_weight => "" They look the same but what it does in category view it shows all prices as Call! even if they are not $0.00 Quote Link to comment Share on other sites More sharing options...
jboras Posted June 18, 2014 Author Share Posted June 18, 2014 I actually got it to work by: In product view: $PRODUCT.price_unformatted retyped in category view as: $product.price.unformatted Now it seems to be working in Product and Category view Also: The navigation panes works as well! Thanks again. Quote Link to comment Share on other sites More sharing options...
Jesy_par Posted August 11, 2014 Share Posted August 11, 2014 Thank you, I tried but for some reason it's not working. You don't need to waste any more time on it. We can live with $0.00 The code was put into: skin/templates/content.product.php as: <h2>{$PRODUCT.name}</h2> <form action="{$VAL_SELF}" method="post" class="addForm"> <div style="overflow:hidden;"> <div id="product_detail"> {if $PRODUCT.ctrl_sale} <h1><span class="price_previous">{$PRODUCT.price}</span> <span class="price_sale">{$PRODUCT.sale_price}</span></h1> {else} .............. 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.