Forum

Thread tagged as: Problem, Shop

PHP Fatal Error

I'm having issues with my cart being a blank page when clicked add to cart. This is the error in the log:

PHP Fatal error: Call to a member function get_prices() on boolean in /home/linweb31/g/geoffready.web-design.wales/user/htdocs/admin/addons/apps/perch_shop/lib/PerchShop_Cart.class.php on line 723

Any help?

cart.html

<!-- breadcrumbs -->
        <div class="breadcrumbs">
            <div class="container">
                <ol class="breadcrumb breadcrumb--ys pull-left">
                    <li class="home-link"><a href="index.php" class="icon icon-home"></a></li>                  
                    <li><a href="shop.php">Shop</a></li>
                    <li class="active">Cart</li>
                </ol>
            </div>
        </div>
        <!-- /breadcrumbs --> 
        <!-- CONTENT section -->
        <div id="pageContent">
            <div class="container">             
                <!-- title -->
                <perch:if id="product_count" match="gt" value="0">
    <perch:form id="cart" app="perch_shop">
                <div class="title-box">
                    <h1 class="text-center text-uppercase title-under">YOUR CART (<perch:shop id="item_count" />)</h1>
                </div>
                <!-- /title -->     
                <!-- Shopping cart table -->
                <div class="container-widget">
                    <table class="shopping-cart-table">
                        <thead>
                            <tr>
                                <th>Product</th>
                                <th>&nbsp;</th>
                                <th>&nbsp;</th>
                                <th>Unit Price</th>
                                <th>Qty</th>
                                <th>Subtotal</th>
                                <th>&nbsp;</th>
                            </tr>
                        </thead>
                        <tbody>
                            <perch:cartitems>
                            <tr>
                                <td>
                                    <div class="shopping-cart-table__product-image">
                                        <a href="product.php?s=<perch:cartitem id="slug"/>">
                                            <img class="img-responsive" src="<perch:cartitem id="image" type="image" width="80" height="80" density="1.6" crop="true" />" alt="<perch:cartitem id="title" />" width="80" height="80">
                                        </a>
                                    </div>
                                </td>
                                <td>
                                    <h5 class="shopping-cart-table__product-name text-left text-uppercase">
                                        <a href="product.php?s=<perch:cartitem id="slug"/>"><perch:cartitem id="title" /></a>
                                    </h5>
                                    <ul class="shopping-cart-table__list-parameters">

                                        <li class="visible-xs">
                                            <span>Price:</span>
                                            <span class="price-mobile"><perch:cartitem id="price_without_tax_formatted" /></span>
                                        </li>
                                        <li class="visible-xs">
                                            <span>Qty:</span>
                                            <!--  -->
                                            <div class="number input-counter">
                                                <span class="minus-btn"></span>
                                                <input type="text" value="1" size="5"/>
                                                <span class="plus-btn"></span>
                                            </div>
                                            <!-- / -->
                                        </li>
                                    </ul>                                                                               
                                </td>
                                <td>
                                    <a class="shopping-cart-table__delete icon icon-delete visible-xs" href="#"></a>
                                </td>
                                <td>
                                    <div class="shopping-cart-table__product-price unit-price">
                                        <perch:cartitem id="price_without_tax_formatted" />
                                    </div>
                                </td>
                                <td>
                                    <div class="shopping-cart-table__input">
                                        <!--  -->
                                        <div class="number input-counter">
                                           <perch:cartitem id="quantity" />
                                        </div>
                                        <!-- / -->
                                    </div>                              
                                </td>
                                <td>
                                    <div class="shopping-cart-table__product-price subtotal">
                                        <perch:cartitem id="total_without_tax_formatted" />
                                    </div>
                                </td>
                                <td>
                                    <a class="shopping-cart-table__delete icon icon-clear" href="#"></a>
                                </td>
                            </tr>                               
                            </perch:cartitems>
                        </tbody>
                    </table>
                </div>
                <!-- /Shopping cart table -->
                <div class="divider divider--xs"></div>
                <div class="clearfix shopping-cart-btns">
                    <perch:input type="submit" value="UPDATE SHOPPING CART" class="btn btn--ys btn--light pull-right" />
                    <div class="divider divider--xs visible-xs"></div>
                    <div class="divider divider--xs visible-xs"></div>
                    <a class="btn btn--ys btn--light pull-left btn-right" href="#"><span class="icon icon-keyboard_arrow_left"></span>CONTINUE SHOPPING </a>         
                    <div class="divider divider--xs visible-xs"></div>      







                </div>              
                <div class="divider--md"></div>
                <div class="row">

                    <div class="col-md-4">
                        <div class=" card card--padding">
                            <h4>DISCOUNT CODES</h4>
                            <form>
                                <div class="form-group">
                                  <label for="inputDiscountCodes">Enter your coupon code if you have one.</label>
                                  <perch:input type="text" id="discount_code" class="form-control" />
                                </div>
                            </form> 
                        </div>
                    </div>
                    <div class="col-md-4">

                    </div>
                    <div class="divider--md visible-sm visible-xs"></div>
                    <div class="col-md-4">
                        <div class="card card--padding">
                            <table class="table-total">
                                <tbody>
                                    <perch:if id="total_discounts" match="gt" value="0.00">
            <tr class="total">
                <th class="text-left">
                    Discount (<perch:shop id="discount_code" />)
                </th>
                <td class="text-right">
                    <perch:shop id="total_discounts" format="$:%.2n" />
                </td>
            </tr>
                                    </perch:if>
                                    <tr>
                                        <th class="text-left">Subtotal:</th>
                                        <td class="text-right"><perch:shop id="total_items_formatted" /></td>
                                    </tr>
                                    <tr>
                                        <th class="text-left">VAT:</th>
                                        <td class="text-right"><perch:shop id="total_tax_formatted" /></td>
                                    </tr>
                                </tbody>
                                <tfoot>
                                    <tr>
                                        <th>GRAND TOTAL:</th>
                                        <td><perch:shop id="grand_total_formatted" /></td>
                                    </tr>
                                </tfoot>
                            </table>
                            <a href="checkout.php" class="btn btn--ys btn--full btn--xl">PROCEED TO CHECKOUT <span class="icon icon--flippedX icon-reply"></span></a>
                            <div class="text-right link-top">
                            </div>
                        </div>
                    </div>
                </div>              
            </div>
        </div>
        <!-- End CONTENT section --> </perch:form>
            <perch:else />
<h1 class="text-center text-uppercase title-under">Your cart is empty.</h1>
</perch:if>
Jade Marling

Jade Marling 0 points

  • 3 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please post your Diagnostic Report and the PHP pages that do the adding to cart.

Diagnostics


Perch: 3.0.12 Production mode: Production (100) Installed apps: content (3.0.12), assets (3.0.12), categories (3.0.12), perch_blog (5.6.1), perch_shop_orders (1.2.5), perch_shop_products (1.2.5), perch_shop (1.2.5), perch_members (1.6.2) DB driver: PDO DB tables: perch3_blog_authors (1), perch3_blog_comments (0), perch3_blog_index (31), perch3_blog_posts (0), perch3_blog_posts_to_tags (0), perch3_blog_sections (1), perch3_blog_tags (0), perch3_blog_webmention_queue (0), perch3_blogs (1), perch3_categories (2), perch3_category_counts (0), perch3_category_sets (2), perch3_content_index (0), perch3_content_items (0), perch3_content_regions (0), perch3_members (2), perch3_members_forms (1), perch3_members_member_tags (2), perch3_members_sessions (0), perch3_members_tags (2), perch3_menu_items (13), perch3_navigation (0), perch3_navigation_pages (0), perch3_page_templates (0), perch3_pages (0), perch3_resource_log (147), perch3_resource_tags (0), perch3_resources (112), perch3_resources_to_tags (0), perch3_settings (38), perch3_shop_addresses (0), perch3_shop_admin_index (32), perch3_shop_brands (1), perch3_shop_cart (3), perch3_shop_cart_data (39), perch3_shop_cart_items (5), perch3_shop_countries (250), perch3_shop_currencies (152), perch3_shop_customers (0), perch3_shop_emails (1), perch3_shop_index (763), perch3_shop_option_values (0), perch3_shop_options (0), perch3_shop_order_items (0), perch3_shop_order_promotions (0), perch3_shop_order_statuses (9), perch3_shop_orders (0), perch3_shop_orders_meta (1), perch3_shop_product_files (0), perch3_shop_product_option_values (0), perch3_shop_product_options (0), perch3_shop_product_tags (0), perch3_shop_products (16), perch3_shop_promotions (0), perch3_shop_sales (0), perch3_shop_search (16), perch3_shop_shipping_zone_countries (1), perch3_shop_shipping_zones (1), perch3_shop_shippings (1), perch3_shop_tax_exhibits (0), perch3_shop_tax_group_rates (1), perch3_shop_tax_groups (1), perch3_shop_tax_locations (1), perch3_shop_tax_rates (1), perch3_shop_variants (0), perch3_user_passwords (0), perch3_user_privileges (75), perch3_user_role_privileges (2), perch3_user_roles (2), perch3_users (1) Users: 1 App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_members', 'perch_shop', ]; Scheduled tasks for perch_blog: delete_spam_comments (1440 mins), publish_posts (1 mins), process_webmentions (1 mins) Editor plug-ins: H1: a89924f60a245ff6a50c17dc3aed1c87 L1: 89628fba18b92a489a843f44574a757b F1: 3b606135b33e6a102526838f4152a807 headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb installedAt: 3.0.12 update_3.0.12: done latest_version: on_sale_version: perch_shop_update: 1.2.5 headerScheme: light perch_shop_price_tax_mode: exc perch_shop_site_url: https:// perch_shop_product_url: product.php?s={slug} perch_shop_default_currency: 47 perch_shop_reporting_currency: 47 perch_shop_invoice_number_format: Invoice%d perch_members_login_page: /members/login.php?r={returnURL} perch_blog_site_name: perch_blog_post_url: post.php?s={postSlug} perch_blog_slug_format: %Y-%m-%d-{postTitle} perch_blog_akismet_key: perch_blog_max_spam_days: 0 dashboard: 0 sidebar_back_link: 0 hide_pwd_reset: 0 keyboardShortcuts: 0 content_hideNonEditableRegions: 0 content_frontend_edit: 0 content_skip_region_list: 0 assets_restrict_buckets: 0 perch_blog_comment_notify: 0 perch_blog_webmention_tx: 0 perch_blog_webmention_rx: 0 perch_blog_update: 5.6 perch_members_update: 1.4 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: designerlighting PERCH_DB_SERVER: 213.171.200.97 PERCH_DB_DATABASE: outdoorlighting PERCH_DB_PREFIX: perch3_ PERCH_TZ: UTC PERCH_EMAIL_FROM: jade@picseli.co.uk PERCH_EMAIL_FROM_NAME: Jade Marling PERCH_LOGINPATH: /admin PERCH_PATH: /home/linweb31/g/geoffready.web-design.wales/user/htdocs/admin PERCH_CORE: /home/linweb31/g/geoffready.web-design.wales/user/htdocs/admin/core PERCH_RESFILEPATH: /home/linweb31/g/geoffready.web-design.wales/user/htdocs/files PERCH_RESPATH: /files PERCH_HTML5: 1 PERCH_DEBUG: 1 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_RUNWAY_ROUTED: PERCH_STRONG_PASSWORDS: PERCH_ASSET_VERSION: f704e7442d11292c99b5 PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /home/linweb31/g/geoffready.web-design.wales/user/htdocs/admin/templates PERCH_TEMPLATE_FILTERS: PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_XHTML_MARKUP: PERCH_RWD: 1 PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_PARANOID: PERCH_FORCE_SECURE_COOKIES: PERCH_DEFAULT_BUCKET: default PERCH_TRANSLATION_ASSIST: PERCH_PASSWORD_MIN_LENGTH: 6 PERCH_MAX_FAILED_LOGINS: 10 PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR PERCH_VERIFY_UPLOADS: PERCH_PRIV_ASSIST: PERCH_CUSTOM_EDITOR_CONFIGS: PERCH_ENABLE_EXIF: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: PERCH_SHOP_VERSION: 1.2.5 PERCH_APPS_EDITOR_PLUGIN: markitup PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown Hosting settings PHP: 5.6.32 Zend: 2.6.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: 5.5.56-MariaDB MySQL server: 5.6.36-log Free disk space: 45.08 GB Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, fileinfo, filter, ftp, gettext, gmp, SPL, iconv, intl, pcntl, session, standard, posix, readline, Reflection, Phar, shmop, SimpleXML, sockets, mbstring, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, cgi-fcgi, bcmath, dba, dom, gd, imap, json, ldap, exif, mcrypt, mssql, mysql, mysqli, odbc, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, pspell, snmp, soap, tidy, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash, ionCube Loader GD: Yes ImageMagick: No PHP max upload size: 20M PHP max form post size: 20M PHP memory limit: 64M Total max uploadable file size: 20M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin PWD: /var/www/fcgi PHP_FCGI_MAX_REQUESTS: 100 ORIG_SCRIPT_NAME: /fcgi-bin/php56-cgi ORIG_PATH_TRANSLATED: /home/linweb31/g/geoffready.web-design.wales/user/htdocs/admin/core/settings/diagnostics/index.php ORIG_PATH_INFO: /admin/core/settings/diagnostics/index.php ORIG_SCRIPT_FILENAME: /var/www/fcgi/php56-cgi SCRIPT_NAME: /admin/core/settings/diagnostics/index.php REQUEST_URI: /admin/core/settings/diagnostics/?extended QUERY_STRING: extended REQUEST_METHOD: GET SERVER_PROTOCOL: HTTP/1.0 GATEWAY_INTERFACE: CGI/1.1 REDIRECT_URL: /admin/core/settings/diagnostics/index.php REDIRECT_QUERY_STRING: extended REMOTE_PORT: 55182 SCRIPT_FILENAME: /home/linweb31/g/geoffready.web-design.wales/user/htdocs/admin/core/settings/diagnostics/index.php SERVER_ADMIN: support@fasthosts.com CONTEXT_DOCUMENT_ROOT: /var/www/fcgi/ CONTEXT_PREFIX: /fcgi-bin/ REQUEST_SCHEME: http DOCUMENT_ROOT: /home/linweb31/g/geoffready.web-design.wales/user/htdocs REMOTE_ADDR: 148.253.169.66 SERVER_PORT: 80 SERVER_ADDR: 127.0.0.1 SERVER_NAME: geoffready.web-design.wales SERVER_SOFTWARE: Apache HTTP_UPGRADE_INSECURE_REQUESTS: 1 HTTP_COOKIE: _ga=GA1.2.551334490.1511967752; PHPSESSID=48qggbpsj2nh14no24aj9imns0; cmsa=1; p_m= HTTP_REFERER: https://geoffready.web-design.wales/admin/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip, deflate HTTP_ACCEPT_LANGUAGE: en-GB,en;q=0.5 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0 HTTP_CONNECTION: close HTTP_X_FORWARDED_FOR: 148.253.169.66 HTTP_X_REAL_IP: 148.253.169.66 HTTP_HOST: geoffready.web-design.wales UNIQUE_ID: WlYphHgYSEJpdAtAdQ-vtwAAACM on: 127.0.0.1 REDIRECT_STATUS: 200 REDIRECT_HANDLER: application/x-httpd-php56 REDIRECT_UNIQUE_ID: WlYphHgYSEJpdAtAdQ-vtwAAACM REDIRECT_on: 127.0.0.1 FCGI_ROLE: RESPONDER PHP_SELF: /admin/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1515596164.5911 REQUEST_TIME: 1515596164

product.html

        <!-- breadcrumbs -->
        <div class="breadcrumbs">
            <div class="container">
                <ol class="breadcrumb breadcrumb--ys pull-left">
                    <li class="home-link"><a href="index.php" class="icon icon-home"></a></li>
                    <li><a href="shop.php">Shop Online</a></li>
                    <li class="active"><perch:shop id="title" type="text" label="Title" required="true" order="2" /></li>
                </ol>
            </div>
        </div>
        <!-- /breadcrumbs --> 
        <!-- CONTENT section -->
        <div id="pageContent">
            <section class="content offset-top-0">
                <div class="container">
                    <div class="row product-info-outer">

                        <div class="col-sm-12 col-md-12 col-lg-12 col-xl-10">
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-6 col-xl-6 hidden-xs">
                                    <div class="product-main-image">
                                        <div class="product-main-image__item"><img class="product-zoom" src='<perch:shop id="image" type="image" label="Main product image" order="7" width="553" divider-before="Images"/>' data-zoom-image="i<perch:shop id="image" type="image" label="Main product image" order="7" width="553" />" alt="" /></div>
                                        <div class="product-main-image__zoom"></div>
                                    </div>
                                    <div class="product-images-carousel">
                                        <ul id="smallGallery">
                                            <li><a href="#" data-image="<perch:shop id="image" type="image" label="Main product image" order="7" width="553" divider-before="Images" />" data-zoom-image="<perch:shop id="image" type="image" label="Main product image" order="7" width="553" />"><img src="<perch:shop id="image" type="image" label="Main product image" order="7" width="553" />" alt="" /></a></li>
                                            <perch:repeater id="gallery" max="8" label="Gallery images" order="6">
                                            <li><a href="#" data-image="<perch:shop id="image2" type="image" label="Gallery image" order="8" width="553" />" data-zoom-image="<perch:shop id="image2" type="image" label="Gallery image" order="8" width="553" />"><img src="<perch:shop id="image2" type="image" label="Gallery image" order="8" width="553" />" alt="<perch:shop id="alt" type="text" label="Alt tag"/>" title="<perch:shop id="alt"/>" /></a></li>
                                        </perch:repeater>
                                        </ul>
                                    </div>
                                </div>
                                <div class="product-info col-sm-6 col-md-6 col-lg-6 col-xl-6">
                                    <div class="wrapper hidden-xs">
                                        <div class="product-info__sku pull-left">SKU: <strong><perch:shop id="sku" type="text" label="SKU" required="true" order="1" /></strong></div>
                                        <div class="product-info__availability pull-right">Availability:   <strong class="color"><perch:shop id="stock_status" type="shop_stock_status" label="Stock status" required="true" divider-before="Stock" order="15" /></strong></div>
                                    </div>
                                    <div class="product-info__title">
                                        <h2><perch:shop id="title" type="text" label="Title" required="true" order="2" /></h2>
                                    </div>
                                    <div class="wrapper visible-xs">
                                        <div class="product-info__sku pull-left">SKU: <strong><perch:shop id="sku" type="text" label="SKU" required="true" order="1" /></strong></div>
                                        <div class="product-info__availability pull-right">Availability:   <strong class="color"><perch:shop id="stock_status" type="shop_stock_status" label="Stock status" required="true" divider-before="Stock" order="15" /></strong></div>
                                    </div>
                                    <div class="visible-xs">
                                        <div class="clearfix"></div>
                                        <ul id="mobileGallery">
                                            <li><a href="#" data-image="<perch:shop id="image" type="image" label="Main product image" order="7" width="553" />" data-zoom-image="<perch:shop id="image" type="image" label="Main product image" order="7" width="553" />"><img src="<perch:shop id="image" type="image" label="Main product image" order="7" width="553" />" alt="" /></a></li>
                                            <perch:repeater id="gallery" max="8" label="Gallery images">
                                            <li><a href="#" data-image="<perch:shop id="image2" type="image" label="Gallery image" order="8" width="553" />" data-zoom-image="<perch:shop id="image2" type="image" label="Gallery image" order="8" width="553" />"><img src="<perch:shop id="image2" type="image" label="Gallery image" order="8" width="553" />" alt="<perch:shop id="alt" type="text" label="Alt tag"/>" title="<perch:shop id="alt"/>" /></a></li>
                                        </perch:repeater>
                                        </ul>
                                    </div>
                                    <div class="price-box product-info__price"><span class="price-box__new"><perch:if id="trade_pricing" value="1">
        <perch:shop id="trade_price" type="shop_currency_value" label="Trade Price" order="10"/>
                <perch:else />
        <perch:shop id="price" type="shop_currency_value" label="Price" divider-before="Pricing" order="9"/>
        </perch:if></span></div>

                                    <div class="divider divider--xs product-info__divider hidden-xs"></div>
                                    <div class="product-info__description hidden-xs">
                                        <div class="product-info__description__text"><perch:shop id="excerpt" type="textarea" label="Excerpt" editor="redactor" html="true" order="3"/></div>
                                    </div>
                                    <div class="divider divider--xs product-info__divider"></div>



                                        <perch:form id="add_to_cart" app="perch_shop" action="cart.php">

    <perch:if exists="has_variants">
      <perch:productopts>
        <h3><perch:productopt id="title" /></h3>
        <perch:productvalues>
          <perch:before><ul class="size-list"></perch:before>
            <li class="value">

                <perch:input id="options" class="form-control input-sm size-variants" name="opt-<perch:productvalue id="optionID" />[]"
                  value="<perch:productvalue id="valueID" />" type="radio" required="required" />
                <perch:productvalue id="valueTitle" />

            </li>
          <perch:after></ul></perch:after>
        </perch:productvalues>
      </perch:productopts>
    </perch:if>
    <br><br>
      <div class="pull-left"><span class="qty-label">QTY:</span></div>
                                            <div class="pull-left">                                         
                                            <!--  -->
                                            <div class="number input-counter">
    <perch:input id="qty" value="1" type="number" min="0" placeholder="0" class="form-control"/>
                                                </div>
                                            <!-- / -->
                                        </div>
    <perch:input id="product" type="hidden" value="<perch:shop id="productID" type="hidden" env-autofill="false" />" />
                                            <div class="pull-left"><perch:input type="submit" value="Add to cart" class="btn btn--ys btn--xxl"/></div>
                                        </perch:form>
                                    </div>












                    </div>
                                </div>



                    </div>
                </div>
            </section>
            <!-- Nav tabs -->
            <div class="container">
                                <ul class="nav nav-tabs nav-tabs--ys1" role="tablist">
                                    <li class="active"><a href="#Tab1"  role="tab" data-toggle="tab" class="text-uppercase">FULL DESCRIPTION</a></li>

                                    <perch:if exists="tab"><li class="active"><a href="#Tab2"  role="tab" data-toggle="tab" class="text-uppercase"><perch:shop id="tab" type="text" label="Tab Title" order="5"/></a></li></perch:if>
                                </ul>
                                <!-- Tab panes -->
                                <div class="tab-content tab-content--ys nav-stacked">
                                    <div role="tabpanel" class="tab-pane active" id="Tab1">
                                        <perch:shop id="description" type="textarea" label="Full Description" editor="redactor" order="4" html="true" size="l" />

                                        <div class="divider divider--md"></div>

                                    </div>
                                    <perch:if exists="tab2">
                                        <div role="tabpanel" class="tab-pane active" id="Tab2">
                                        <perch:shop id="tab2" type="textarea" label="Tab Content" editor="redactor" order="6" html="true" size="l" />

                                        <div class="divider divider--md"></div>


                                </div>  
                                    </perch:if>
                            </div>
            </div>



<perch:shop id="image" type="image" label="Main product image" order="7" width="80"  suppress="true"/>
<perch:shop id="slug" type="slug" editable="true" indelible="true" label="Slug" for="title" order="12" divider-before="Meta data" />
<perch:shop id="status" type="shop_status" label="Status" order="13" />

<perch:categories id="category" set="products" label="Category" order="14">
    <perch:category id="catTitle" />
</perch:categories>

<perch:shop id="tax_group" type="shop_tax_group" label="Tax group" required="true" order="11"/>


<perch:shop id="stock_level" type="number" label="Stock level" size="s" order="16"/>
<perch:shop id="stock_location" type="shop_stock_location" label="Count stock" order="17"/>

<perch:shop id="requires_shipping" type="shop_requires_shipping" label="Requires shipping" divider-before="Shipping" order="18"/>

            <perch:shop id="SEO" type="textarea" label="SEO" order="19"/>

cart.html

<!-- breadcrumbs -->
        <div class="breadcrumbs">
            <div class="container">
                <ol class="breadcrumb breadcrumb--ys pull-left">
                    <li class="home-link"><a href="index.php" class="icon icon-home"></a></li>                  
                    <li><a href="shop.php">Shop</a></li>
                    <li class="active">Cart</li>
                </ol>
            </div>
        </div>
        <!-- /breadcrumbs --> 
        <!-- CONTENT section -->
        <div id="pageContent">
            <div class="container">             
                <!-- title -->
                <perch:if id="product_count" match="gt" value="0">
    <perch:form id="cart" app="perch_shop">
                <div class="title-box">
                    <h1 class="text-center text-uppercase title-under">YOUR CART (<perch:shop id="item_count" />)</h1>
                </div>
                <!-- /title -->     
                <!-- Shopping cart table -->
                <div class="container-widget">
                    <table class="shopping-cart-table">
                        <thead>
                            <tr>
                                <th>Product</th>
                                <th>&nbsp;</th>
                                <th>&nbsp;</th>
                                <th>Unit Price</th>
                                <th>Qty</th>
                                <th>Subtotal</th>
                                <th>&nbsp;</th>
                            </tr>
                        </thead>
                        <tbody>
                            <perch:cartitems>
                            <tr>
                                <td>
                                    <div class="shopping-cart-table__product-image">
                                        <a href="product.php?s=<perch:cartitem id="slug"/>">
                                            <img class="img-responsive" src="<perch:cartitem id="image" type="image" width="80" height="80" density="1.6" crop="true" />" alt="<perch:cartitem id="title" />" width="80" height="80">
                                        </a>
                                    </div>
                                </td>
                                <td>
                                    <h5 class="shopping-cart-table__product-name text-left text-uppercase">
                                        <a href="product.php?s=<perch:cartitem id="slug"/>"><perch:cartitem id="title" /></a>
                                    </h5>
                                    <ul class="shopping-cart-table__list-parameters">

                                        <li class="visible-xs">
                                            <span>Price:</span>
                                            <span class="price-mobile"><perch:cartitem id="price_without_tax_formatted" /></span>
                                        </li>
                                        <li class="visible-xs">
                                            <span>Qty:</span>
                                            <!--  -->
                                            <div class="number input-counter">
                                                <span class="minus-btn"></span>
                                                <input type="text" value="1" size="5"/>
                                                <span class="plus-btn"></span>
                                            </div>
                                            <!-- / -->
                                        </li>
                                    </ul>                                                                               
                                </td>
                                <td>
                                    <a class="shopping-cart-table__delete icon icon-delete visible-xs" href="#"></a>
                                </td>
                                <td>
                                    <div class="shopping-cart-table__product-price unit-price">
                                        <perch:cartitem id="price_without_tax_formatted" />
                                    </div>
                                </td>
                                <td>
                                    <div class="shopping-cart-table__input">
                                        <!--  -->
                                        <div class="number input-counter">
                                           <perch:cartitem id="quantity" />
                                        </div>
                                        <!-- / -->
                                    </div>                              
                                </td>
                                <td>
                                    <div class="shopping-cart-table__product-price subtotal">
                                        <perch:cartitem id="total_without_tax_formatted" />
                                    </div>
                                </td>
                                <td>
                                    <a class="shopping-cart-table__delete icon icon-clear" href="#"></a>
                                </td>
                            </tr>                               
                            </perch:cartitems>
                        </tbody>
                    </table>
                </div>
                <!-- /Shopping cart table -->
                <div class="divider divider--xs"></div>
                <div class="clearfix shopping-cart-btns">
                    <perch:input type="submit" value="UPDATE SHOPPING CART" class="btn btn--ys btn--light pull-right" />
                    <div class="divider divider--xs visible-xs"></div>
                    <div class="divider divider--xs visible-xs"></div>
                    <a class="btn btn--ys btn--light pull-left btn-right" href="#"><span class="icon icon-keyboard_arrow_left"></span>CONTINUE SHOPPING </a>         
                    <div class="divider divider--xs visible-xs"></div>      







                </div>              
                <div class="divider--md"></div>
                <div class="row">

                    <div class="col-md-4">
                        <div class=" card card--padding">
                            <h4>DISCOUNT CODES</h4>
                            <form>
                                <div class="form-group">
                                  <label for="inputDiscountCodes">Enter your coupon code if you have one.</label>
                                  <perch:input type="text" id="discount_code" class="form-control" />
                                </div>
                            </form> 
                        </div>
                    </div>
                    <div class="col-md-4">

                    </div>
                    <div class="divider--md visible-sm visible-xs"></div>
                    <div class="col-md-4">
                        <div class="card card--padding">
                            <table class="table-total">
                                <tbody>
                                    <perch:if id="total_discounts" match="gt" value="0.00">
            <tr class="total">
                <th class="text-left">
                    Discount (<perch:shop id="discount_code" />)
                </th>
                <td class="text-right">
                    <perch:shop id="total_discounts" format="$:%.2n" />
                </td>
            </tr>
                                    </perch:if>
                                    <tr>
                                        <th class="text-left">Subtotal:</th>
                                        <td class="text-right"><perch:shop id="total_items_formatted" /></td>
                                    </tr>
                                    <tr>
                                        <th class="text-left">VAT:</th>
                                        <td class="text-right"><perch:shop id="total_tax_formatted" /></td>
                                    </tr>
                                </tbody>
                                <tfoot>
                                    <tr>
                                        <th>GRAND TOTAL:</th>
                                        <td><perch:shop id="grand_total_formatted" /></td>
                                    </tr>
                                </tfoot>
                            </table>
                            <a href="checkout.php" class="btn btn--ys btn--full btn--xl">PROCEED TO CHECKOUT <span class="icon icon--flippedX icon-reply"></span></a>
                            <div class="text-right link-top">
                            </div>
                        </div>
                    </div>
                </div>              
            </div>
        </div>
        <!-- End CONTENT section --> </perch:form>
            <perch:else />
<h1 class="text-center text-uppercase title-under">Your cart is empty.</h1>
</perch:if>
Drew McLellan

Drew McLellan 2638 points
Perch Support

The cart is trying to find a product ID that doesn't exist. How has the item been added to the cart?

So I need to add the SKU to the cart page? This is my add tor cart button

<perch:form id="add_to_cart" app="perch_shop" action="cart.php">

    <perch:if exists="has_variants">
      <perch:productopts>
        <h3><perch:productopt id="title" /></h3>
        <perch:productvalues>
          <perch:before><ul class="size-list"></perch:before>
            <li class="value">

                <perch:input id="options" class="form-control input-sm size-variants" name="opt-<perch:productvalue id="optionID" />[]"
                  value="<perch:productvalue id="valueID" />" type="radio" required="required" />
                <perch:productvalue id="valueTitle" />

            </li>
          <perch:after></ul></perch:after>
        </perch:productvalues>
      </perch:productopts>
    </perch:if>
    <br><br>
      <div class="pull-left"><span class="qty-label">QTY:</span></div>
                                            <div class="pull-left">                                         
                                            <!--  -->
                                            <div class="number input-counter">
    <perch:input id="qty" value="1" type="number" min="0" placeholder="0" class="form-control"/>
                                                </div>
                                            <!-- / -->
                                        </div>
    <perch:input id="product" type="hidden" value="<perch:shop id="productID" type="hidden" env-autofill="false" />" />
                                            <div class="pull-left"><perch:input type="submit" value="Add to cart" class="btn btn--ys btn--xxl"/></div>
                                        </perch:form>
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you load the page, what value is populated in the product hidden field?

YWRkX3RvX2NhcnQ6cGVyY2hfc2hvcDpcdGVtcGxhdGVzXHNob3BccHJvZHVjdHNccHJvZHVjdC5odG1sOjE1MTU2NjY0MDA

Drew McLellan

Drew McLellan 2638 points
Perch Support

That value is the form control, so if it's ending up in your product field you've got big issues but would explain the problem you're seeing.

Can you double check?

I'm not really sure what you want me to double check?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

is that really what is ending up in the product field?

I apologise it's this:

 <input id="form1_product" name="product" value="12" type="hidden">
<div class="pull-left"><input class="btn btn--ys btn--xxl" value="Add to cart" type="submit"><input type="hidden" name="cms-form" value="YWRkX3RvX2NhcnQ6cGVyY2hfc2hvcDovdGVtcGxhdGVzL3Nob3AvcHJvZHVjdHMvcHJvZHVjdC5odG1sOjE1MTU2NzMyODI="></div>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is product 12 a valid product in your system?

Yes it is see debug on product

SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='f5ae06bfd21f98955957a7155fc735da' LIMIT 1
UPDATE perch3_users SET userHash='7bdc9c58ad29920781a0911d1e87e46f' WHERE userID='1'
[38] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[11] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1] SELECT * FROM perch3_shop_products WHERE productID='12' AND productDeleted IS NULL LIMIT 1
Using template: /templates/shop/products/product.html
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[6] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='perch_shop_products' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /addons/apps/perch_shop_products/modes/product.edit.post.php
[1] SELECT * FROM perch3_resources WHERE resourceID='21' LIMIT 1

Array
(
    [w] => 493
    [h] => 393
    [target_w] => 553
    [target_h] => 
    [crop] => 
    [density] => 1
    [path] => d06s-single-w553.jpg
    [size] => 15451
    [mime] => 
    [assetID] => 27
)

[1] SELECT * FROM perch3_resources WHERE resourceID='23' LIMIT 1

Array
(
    [w] => 553
    [h] => 349
    [target_w] => 553
    [target_h] => 
    [crop] => 
    [density] => 1
    [path] => garden-lighting1-w553.jpg
    [size] => 42933
    [mime] => 
    [assetID] => 25
)

[1] SELECT * FROM perch3_resources WHERE resourceID='95' LIMIT 1

Array
(
    [w] => 553
    [h] => 414
    [target_w] => 553
    [target_h] => 
    [crop] => 
    [density] => 1
    [path] => 2xd0s2xd07strans-w553.jpg
    [size] => 25313
    [mime] => 
    [assetID] => 97
)

[1] SELECT * FROM perch3_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode
[1] SELECT * FROM perch3_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode
[1] SELECT * FROM perch3_shop_tax_groups WHERE 1=1 AND groupDeleted IS NULL ORDER BY groupTitle ASC
[2] SELECT * FROM perch3_categories c, perch3_category_sets s WHERE c.setID=s.setID AND s.setSlug='products' ORDER BY catTreePosition ASC
Mode: product.edit
Queries: 18
Memory: 6.7522