Results 1 to 4 of 4
  1. #1
    Join Date
    May 2013
    Location
    Ireland
    Posts
    9
    Plugin Contributions
    0

    Default add custom price to cart

    hopefully someone can offer some help on this as I am a little confused

    I have added a simple calculation script in tpl.product_info_display.php that requires users to input the width and height of the product they require. A simple calculation is then done in the backend to produce the price. I now need to add that price to cart when the customer clicks add to cart or I could add it to the cost of the product. Whichever is simpler.

    An example is:

    Customer wants to purchase t-shirt @ £1.25 They then want to customise it and require the customisation to be 8 inches x 2.5 inches. My simple script then works out the price and this is added to the existing price of the t-shirt, or if simpler, added to cart with the t-shirt when customer clicks add to cart.

    Does anyone know how this can be done or lead me in the right direction?

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: add custom price to cart

    Quote Originally Posted by johndoes View Post
    Does anyone know how this can be done or lead me in the right direction?
    There'll be many ways to do this. One of the simplest (in my opinion) is, when the calculation has been made in the backend, save it as a $_SESSION variable, then read it back in and add it to the item cost as/when the product is added to the cart (whatever page that may be on).

    Well, that's the basic theory/principle. Whether you'll find it to be of any useful help is another matter.

    Cheers
    Rod

  3. #3
    Join Date
    May 2013
    Location
    Ireland
    Posts
    9
    Plugin Contributions
    0

    Default Re: add custom price to cart

    Thanks Rod. PHP isn't my strong point though. Would you know of any previous forum posts of other peoples attempts at something similar or even any particular keywords to get me started?

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: add custom price to cart

    Quote Originally Posted by johndoes View Post
    Thanks Rod. PHP isn't my strong point though. Would you know of any previous forum posts of other peoples attempts at something similar or even any particular keywords to get me started?
    Try this:
    http://www.w3schools.com/php/php_sessions.asp

    Cheers
    Rod

 

 

Similar Threads

  1. v151 How to pass in custom price from remote add to cart?
    By joeydev in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 1 Mar 2014, 07:34 PM
  2. Display price/add to cart - show price only?
    By wolf99 in forum Customization from the Admin
    Replies: 43
    Last Post: 10 Oct 2011, 02:14 PM
  3. Can admin add items to cart / custom price?
    By Brian1234 in forum General Questions
    Replies: 3
    Last Post: 12 Feb 2008, 10:12 PM
  4. Is it possible to add an images section to store without price/add to cart?
    By jdjohnson99 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Sep 2007, 04:37 AM
  5. custom price from email, add to cart?
    By [email protected] in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 10 May 2007, 02:16 PM

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