Insert the product sale price in code
I've been searching around trying to find a variable for the product special price.
I'm adding optional financing to my products and I need to feed the script with the price.
Here is part of the code:
<div class="CIT-widget cit-widget-inline-button" cit-data-type="outlined"
cit-data-amount="5000">
It's the 5000 that needs to be replaced with a variable string for my sales special price. Ideal would be a function that inserts what ever price is the lowest (base, special or salemaker price).
Does anyone know the name of the variable for the special price?
Thanks!
Re: Insert the product sale price in code
Are you wanting: zen_get_products_display_price($products_id)?
Re: Insert the product sale price in code
Quote:
Originally Posted by
mc12345678
Are you wanting: zen_get_products_display_price($products_id)?
Yes! That's probably the right one, what's the correct syntax in the code? (I need to add it as html in the product description field)
Re: Insert the product sale price in code
Quote:
Originally Posted by
pexter
Yes! That's probably the right one, what's the correct syntax in the code? (I need to add it as html in the product description field)
Okay, so first, based on your description of what you wanted in the html code, I gave you the wrong function. The function I provided includes other html as an output.
The function that seems to fit your description is: zen_get_products_special_price($product_id, $specials_price_only=false)
Now, the thing is you are saying that you want to execute php code inside of your description... That requires a modification of code to use say swguy's boiler plate code to be able to execute the desired operation.
If you otherwise wanted to have that data say before or after the description then it could be added into the applicable tpl_PRODUCT_TYPE_info.php template file. To get what may be expected to be the "lowest" price, you would use:
Code:
<?php echo zen_get_products_special_price((int)$_GET['products_id'], false); ?>
Where you wanted that price to be shown. The function outputs the base price of the product if there is no special or sale, the specials price if there is no sale, or the sale price if there is a sale.
Re: Insert the product sale price in code
I added it to the /templates/tpl_product_info_display.php file and it works like a charm! Thank you so much!
Next thing is to skip the code if product price is below $2000, any ideas? EDIT: Never mind, the finance institute doesn't send anything back if the price is too low! :D
Re: Insert the product sale price in code
Quote:
Originally Posted by
pexter
I added it to the /templates/tpl_product_info_display.php file and it works like a charm! Thank you so much!
Next thing is to skip the code if product price is below $2000, any ideas? EDIT: Never mind, the finance institute doesn't send anything back if the price is too low! :D
Was going to answer with another question of "which price" being less than $2000.