Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Displaying the product's total price on product info display page?

    I'd like to display the product's total price (starting at price + sum of selected attribute prices) in the 'Add to Cart Box'. I looked at the attributes.php module and checked out the tpl_shopping_cart.php files but can't wrap my head around how to display this info. Does anyone know of a solution? We are getting complaints from customers about not knowing how much a product is before adding it to their cart. Our products can sometimes have upwards of 15 attributes and the customers don't want to manually add it up in their head or check out the cart page with the product added.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,152
    Plugin Contributions
    11

    Default Re: Displaying the product's total price on product info display page?

    Checkout the Dynamic Price Updater Mod at https://www.zen-cart.com/downloads.php?do=file&id=1301.

    Example at https://allpecans.com/index.php?main...roducts_id=117

    Select a size then, press the down arrow through the selections. Notice the price changes in the Price Breakdown sidebox and at the Your Price.

  3. #3
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: Displaying the product's total price on product info display page?

    Is this compatible with version 1.5.6?

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

    Default Re: Displaying the product's total price on product info display page?

    Quote Originally Posted by clam_man View Post
    Is this compatible with version 1.5.6?
    Yes it is. The compatibility though would depend more on your template than anything. There are settings in the configuration section to help. Also, since the module uses javascript, would suggest verifying that your product information pages already pass html validation before adding the module.

    If there are any issues with its use, would suggest posting to the forum help thread provided in the download link given by dbltoe.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: Displaying the product's total price on product info display page?

    I saw that it was going to make changes to the database for some reason so I decided against installing it. It took a few hours, but 51 lines of JavaScript later, I've got exactly what I wanted. I used regular expressions on the selected radio labels and drop-down options to sum those associated costs with the starting price of the product. If anyone is interested in more about how I did this, feel free to PM me! It even works with MAP pricing.

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

    Default Re: Displaying the product's total price on product info display page?

    Quote Originally Posted by clam_man View Post
    I saw that it was going to make changes to the database for some reason so I decided against installing it. It took a few hours, but 51 lines of JavaScript later, I've got exactly what I wanted. I used regular expressions on the selected radio labels and drop-down options to sum those associated costs with the starting price of the product. If anyone is interested in more about how I did this, feel free to PM me! It even works with MAP pricing.
    Nothing like redesigning the wheel. Yes, it makes changes to the database by adding it's own configuration options. It doesn't affect core database values but allows the store owner to turn on/off features, to assign html id/class information to which to associate, whether a sidebox should be made available, etc...
    Hopefully you have considered the cases where an attribute may not be on sale when the product is on sale, that the attribute is free/or not when the product is free, whether the attribute is part of the base price, required, etc...

    Also, be advised, that in the majority of cases, if you think you have a viable program, might as well package it up and provide it as a plugin. There are those that may reach out to you about this, but as an open source platform, sharing the solution is considered the way to go.

    Congrats on developing your solution.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: Displaying the product's total price on product info display page?

    I am interested in publishing this solution if possible but I definitely would have some changes to make to the code before that would be possible. I'm great with PHP and great with MySQL but not necessarily great with the merging of the two. Currently there's a couple template changes I had to make to give the quantity_box an ID so it could be referenced and give it an onkeyup function and I made changes to includes/modules/attributes.php to add 'onchange' functions to the radio buttons and dropdown menus. I am currently using integers of the max option name IDs to run my loop but I'd love to find out how to pull that data from the database so this is more scalable and usable by others without the user having to set it up to be unique for their store's database. Currently this solution is all JS but I can probably translate it to PHP if necessary. The only other thing I'm not checking for which, might be a problem for other stores, is for option values that include a currency sign in them. None of our tens of thousands of attributes include dollar signs so I didn't have to include that functionality with the regular expression I came up with.

 

 

Similar Threads

  1. v151 Displaying Starting at: Price on the product info page
    By Kevin205 in forum General Questions
    Replies: 3
    Last Post: 26 Oct 2013, 03:50 PM
  2. Displaying new product fields on the Product Info Page
    By Jdavidb0216 in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 18 Aug 2011, 03:20 PM
  3. display total price on product info page
    By shaz915 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Mar 2010, 09:19 PM
  4. Is it possible to display product info without the price?
    By emark in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 26 Jan 2010, 11:24 AM
  5. Move currency dropdown box under product price on the product info page
    By opelben in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 11 May 2006, 06:31 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