Jump to content

Display message to call from price instead of showing $0.00


jboras

Recommended Posts

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?

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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