Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2009
    Location
    Victoria Australia
    Posts
    100
    Plugin Contributions
    0

    Default Change the function of a button

    This is really a teach me how to fish request.
    I want to change what a button "does."
    I have an update button below a shipping estimate form that adds an item to the cart rather than the intended retrieval of a shipping estimate. Changing the text of the button isn't the problem, I want to obviously change what it does.
    I've been struggling with this for a couple of days, hopping that figuring it out myself would further my education of PHP and zen cart, but now must admit defeat.
    Essentially I'm trying to allow customers to get a shipping estimate on the product info page without creating an account.
    I managed to get my ozpost module to display it's country drop down and form for inputting post code along with the appropriate text ect. Problem is the "update" button just adds the product to their cart, it doesn't return the shipping estimate
    It's obvious whats going on but how do I fix this?
    What file is "telling" the button what to do?
    Any help would be appreciated, thanks
    David

    countrytothecore.net

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Change the function of a button

    You have the submit buttons in the same form ...

    Because the default quantity is 1, it adds one to the cart each time ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jan 2009
    Location
    Victoria Australia
    Posts
    100
    Plugin Contributions
    0

    Default Re: Change the function of a button

    Thanks for the reply.
    I do get that. What I don't get is how to change the button to perform the task I want.
    I've been studying php on the w3 site, but still can't figure out what part of the code to change.
    Is my code for performing the estimate totaly missing?
    Is the submit button just misplaced on the page?
    Thanks,
    David

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Change the function of a button

    This is part of the problem ...

    The shopping_cart is nice with the shipping estimator there as the customer knows what they are getting a quote on ...

    It appears that you are trying to get a shipping quote on the current product ...

    Unless you were rewriting a heck of a lot of code, this isn't going to work very well ...

    There is nothing built in to support separate shipping at the per product level ... it is designed as a total shipping charge for everything that has been added ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jan 2009
    Location
    Victoria Australia
    Posts
    100
    Plugin Contributions
    0

    Default Re: Change the function of a button

    Thanks again for your answer.
    I realized after I started plugging away at this that it was something out of the ordinary for zen cart to do, but it's something I really want to do. My shop is new (still testing the waters and functionality before I refocus my energies on uploading my products.)
    What I have noticed so far is that every other e-mail I get is asking how much shipping will be, by browsers who have not "signed up"
    I can only assume that many more are bouncing without bothering to write an e-mail.
    Personally I rarely shop online and this is one of the reasons. I want to see the entire cost up front before I start filling out forms.

    So it seems that your saying it's more than just changing the function of the button (or adding a second) that will retrieve a quote for a visitor.
    Any advice as to where I should go from here? What files I should look at modifying?

    BTW I am planning on adding some text IE "This is an estimate for this single item only." or something of that effect.
    Thanks for your time,
    David

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Change the function of a button

    Since your shop does not go to the shopping_cart when adding to the cart ... you might make it easier on your self and just make a shipping estimator to go to the shopping cart ...

    So you could make it where there is text that says, add to cart for shipping estimates ... then when things are in the cart, change to the shipping estimator button ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jan 2009
    Location
    Victoria Australia
    Posts
    100
    Plugin Contributions
    0

    Default Re: Change the function of a button

    Linda, thank you for all your help.
    I've been busy with other things and just got back to this today.
    I took your advice and added text and a "estimate shipping" button that takes the user to the cart.
    Wrapped it in a div and styled it. It doesn't look too bad. Managed to keep it in the fold, so I think this will still accomplish what I wanted.

    Two issues still...After retrieving an estimate, the back to shopping button has it url changed...SOMETIMES. It stays on the shopping cart page instead of returning to the previous product info page.
    What controls this url?
    I haven't narrowed down in what "status" this happens and when it doesn't. I know it seems odd, and I'm pretty sure I haven't gone mad yet.

    Second possibly related issue... If a user doesn't add the item to the cart on the product info page before clicking the estimate button, they end up on the empty cart screen. Which is correct as the button is linked to the cart page... Thing is I added some bold text to the empty cart page, hoping (in vain) that at this point they might read the instructions they missed on product info. However it is the shopping cart page (in empty state) and not temp shopping cart page.
    Remember I'm trying to get this to work for visitors.

    If you have any insight, it would be greatly appreciated.
    Thanks,
    David

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Change the function of a button

    Add another line of text for when the product is not in the cart to say Need a Shipping Estimate? Add this Product to the Cart?

    or something along that line ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v151 How to change the button width that in the INPUT element when the css button is used?
    By su35 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Jun 2013, 04:34 PM
  2. how do i change the position of the add to cart button ?
    By what44 in forum Templates, Stylesheets, Page Layout
    Replies: 39
    Last Post: 11 Feb 2011, 05:32 PM
  3. Change the Add to Cart button to Buy Now button
    By dastudio in forum Customization from the Admin
    Replies: 1
    Last Post: 24 Nov 2010, 09:44 PM
  4. How do i change the size of the search button at the top?
    By lenswipe in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Jul 2009, 06:44 AM
  5. Where do I change the alt image tag for the "Sold Out' Button?
    By candylotus in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 9 May 2008, 05:00 AM

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