Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4060968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:24:24+00:00 2026-05-20T15:24:24+00:00

This example shows how to add a field to let customers to choose their

  • 0

This example shows how to add a field to let customers to choose their own price. But the button in that example is for fast checkout. I am trying to add the customer-chosen price to cart? How do I do this?

The code that I have (google app engine – python) adds the item to the cart but not the price; the price is always zero. This is the code I am using:

self.response.out.write("""

$ <input type="text" name="item_price_1"/>

<div class="product">
<input type="hidden" class="product-title" value="%s">

<input type="hidden" class="product-attr-id" value="id#%s">

<div class="googlecart-add-button" tabindex="0" role="button" title="Add to cart">
</div></div>

And this is the sandbox script:

#sandbox script 
self.response.out.write("""<script  id='googlecart-script' type='text/javascript' src='https://checkout.google.com/seller/gsc/v2_2/cart.js?mid=1234567890' integration='jscart-wizard' post-cart-to-sandbox='true' currency='USD' productWeightUnits='LB'></script> """) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:24:25+00:00Added an answer on May 20, 2026 at 3:24 pm

    I solved the problem:

    According to documentation, javascript to add the items to cart only processes

    elements that appear within a tag that uses the CSS product class.
    For example, in the HTML snippet above, if the price (and the
    product-price class) appeared outside of the element,
    the shopping cart JavaScript would not identify a price for the item.

    So added $ <input type="text" name="item_price_1"/> inside the <div class="product"> as class="product-price":

    <div class="product">
    <input type="hidden" class="product-title" value="%s">
    $ <input type="text" class="product-price" name="item_price_1"/>
    <input type="hidden" class="product-attr-id" value="id#%s">
    
    <div class="googlecart-add-button" tabindex="0" role="button" title="Add to cart">
    </div></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This example shows what I am trying to do: http://jsfiddle.net/Dqjvy/ I would like it
Currently, this example shows an unordered list with 8 list items in it. Is
This jsfiddle example shows what I'm talking about, I gave the div in question
The example on this page only shows Groovy assertions without parentheses. assert a !=
So I'm having a bit of trouble understanding this example that was shown in
My brother wrote this code for me to show an example of polymorhism. But
This is a stupid example but I'm trying to understand how thing get passed
Well I know that this question may be asked many times but certainly I've
I'm trying to add visible text to a password field that says Enter a
I'd like to have a field that doesn't show at first, but if the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.