Forum

Thread tagged as: Suggestions, Runway, Shop

Shop - Additional Product Data with Hidden Fields

Hi,

I'm building an interface for a client who's selling beer online. They want customers to drag and drop 'bottles' into a 'box' so they can select a random choice of 12 bottles per box.

There are currently 3 beer options for each bottle (soon to be 6 options) - so creating variations in the normal way fails (white screen of death). Is there an alternative way? I see Product Personalisations are on the roadmap - which I guess would work - but my client is keen to get this online asap. Can I:

  • Add a text field to the order which would simply contain a list of their preferred bottles?
  • Access the data stored in perch2_shop_cart_data > cartData (this field stores values I pass with the product ID, but I can't see how to display this data in the Cart):
<perch:form id="add_to_cart" app="perch_shop" action="/shop-beta/cart">
    <label>Abbey Blonde <perch:input type="number" id="AbbeyBlonde" max="12" /></label>
        <label>Jet Black <perch:input type="number" id="JetBlack" max="12" /></label>
    <label>Whitby Whaler <perch:input type="number" id="WhitbyWhaler" max="12" /></label>
    <perch:input id="product" type="hidden" value="<perch:shop id="productID" type="hidden" env-autofill="false" />" />
    <perch:input type="submit" value="Add to cart" />
</perch:form>

Name/Qty stored in Database:

database screenshot

Is there anyway to make use of this data elsewhere? (Cart/checkout/order processing)

Diagnostic report:

    Perch Runway: 2.8.31, PHP: 5.6.27-0+deb8u1, MySQL: 5.5.53, with PDO
    Server OS: Linux, apache2handler
    Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_events (1.9.3), perch_forms (1.8.3), perch_shop_orders (1.0.6), perch_shop_products (PERCH_SHOP_VERSION), perch_shop (1.0.6), perch_members (1.5)
    App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', 'perch_shop', 'perch_events', 'perch_forms', );
    PERCH_LOGINPATH: /perch
    PERCH_PATH: /srv/whitby-brewery.com/public/htdocs/perch
    PERCH_CORE: /srv/whitby-brewery.com/public/htdocs/perch/core
    PERCH_RESFILEPATH: /srv/whitby-brewery.com/public/htdocs/perch/resources
    Image manipulation: GD Imagick
    PHP limits: Max upload 30M, Max POST 30M, Memory: 128M, Total max file upload: 30M
    F1: 2edba60ed1f613d6dd804feb202456a2
    Resource folder writeable: Yes
    HTTP_HOST: www.whitby-brewery.com
    DOCUMENT_ROOT: /srv/whitby-brewery.com/public/htdocs/
    REQUEST_URI: /perch/core/settings/diagnostics/
    SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Any suggestions gratefully received!

Jack Barber

Jack Barber 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Sorry, this got buried somehow and I see it's gone unanswered.

This sounds alarming:

There are currently 3 beer options for each bottle (soon to be 6 options) - so creating variations in the normal way fails (white screen of death).

That's not normal. Do you get an error?