Results 1 to 6 of 6
  1. #1
    Join Date
    May 2013
    Location
    Karlskoga, Sweden
    Posts
    48
    Plugin Contributions
    0

    Default 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!

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Insert the product sale price in code

    Are you wanting: zen_get_products_display_price($products_id)?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2013
    Location
    Karlskoga, Sweden
    Posts
    48
    Plugin Contributions
    0

    Default Re: Insert the product sale price in code

    Quote Originally Posted by mc12345678 View Post
    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)
    Last edited by pexter; 7 Dec 2018 at 10:23 PM.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Insert the product sale price in code

    Quote Originally Posted by pexter View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    May 2013
    Location
    Karlskoga, Sweden
    Posts
    48
    Plugin Contributions
    0

    Default 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!

  6. #6
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Insert the product sale price in code

    Quote Originally Posted by pexter View Post
    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!
    Was going to answer with another question of "which price" being less than $2000.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v151 Adding sale tracking code for price comparison website
    By louisapple in forum General Questions
    Replies: 2
    Last Post: 4 Sep 2015, 03:31 AM
  2. Replies: 9
    Last Post: 25 Mar 2013, 09:31 AM
  3. v138a Sale Maker Do not show the price on the Product Page
    By oraib in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 6 Sep 2012, 02:43 PM
  4. How to ignore sale price and apply group Discount to original product price?
    By cushietushies in forum Setting Up Specials and SaleMaker
    Replies: 2
    Last Post: 25 Jul 2008, 05:51 AM
  5. Replies: 4
    Last Post: 28 Apr 2008, 04:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR