Forum

Thread tagged as: Question, Problem, Shop

perch_shop_products() error

Im trying to setup my shop and display the products on my shop, but when I use the perch_shop_products() I get the following errors:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ayzhus1/public_html/TSS-new-site/index.php:316) in /home/ayzhus1/public_html/perch/addons/apps/perch_shop/lib/PerchShop_Session.class.php on line 15

Warning: Cannot modify header information - headers already sent by (output started at /home/ayzhus1/public_html/TSS-new-site/index.php:316) in /home/ayzhus1/public_html/perch/addons/apps/perch_shop/lib/PerchShop_Session.class.php on line 34

Can someone help me to understand what is happening?

Habib Anwar

Habib Anwar 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Hello!

Can you give us:

  1. Your Diagnostics Report
  2. The code of the page in question

We need these to be able to help which is why we ask for them when you post to the forum.

Sure, my diagnostics report:

Debug Message [1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='dc2ccde66ce3f58f4417ebb794294276' LIMIT 1 UPDATE perch2_users SET userHash='3f156d98239269c283aa1c0efbb0d238' WHERE userID='1' [30] SELECT p.privKey FROM perch2_user_privileges p [24] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID [nil] SELECT collectionID, collectionKey, collectionEditRoles FROM perch2_collections WHERE collectionInAppMenu=1 ORDER BY collectionOrder ASC SELECT * FROM perch2_scheduled_tasks WHERE 1=1 ORDER BY taskStartTime DESC LIMIT 20 Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ayzhus1_perch.perch2_scheduled_tasks' doesn't exist Queries: 6 Memory: 3.4219

And the code in question is the basic <?php perch_shop_products(); ?>

It had alterations, but because of the error I tried it plain as it is and is giving me those errors, and I tried a simple perch_content and that one works with no problems.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you set up your scheduled tasks?

I think that is part of my problem, Im not sure what steps I need to follow to set up the store app, I did everything within the perch system (taxes, shipping, etc) but I couldnt find how to setup my website to display the app and interact with the backend, can you guide me in these please? There is anywhere that I can see an example of the Perch Shop App installed or the steps?

And no, that I know, I have not set up scheduled tasks

Drew McLellan

Drew McLellan 2638 points
Perch Support

Could you do so?

I did, and I dont get the error in the Debug Messages but I still the one of the <?php perch_shop_products(); ?>

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you post your diagnostics report from the Settings section?

Perch Runway: 2.8.29 Production mode: Production (100) Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_shop_orders (1.0), perch_shop_products (1.0), perch_shop (1.0.1), perch_members (1.5) DB driver: PDO DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_categories (0), perch2_category_counts (0), perch2_category_sets (1), perch2_collection_index (0), perch2_collection_items (0), perch2_collection_revisions (0), perch2_collections (0), perch2_content_index (0), perch2_content_items (0), perch2_content_regions (1), perch2_members (0), perch2_members_forms (0), perch2_members_member_tags (0), perch2_members_sessions (0), perch2_members_tags (0), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_routes (0), perch2_page_templates (0), perch2_pages (1), perch2_resource_log (0), perch2_resource_tags (0), perch2_resources (0), perch2_resources_to_tags (0), perch2_scheduled_tasks (0), perch2_settings (24), perch2_shop_addresses (0), perch2_shop_admin_index (23), perch2_shop_brands (6), perch2_shop_cart (2), perch2_shop_cart_data (0), perch2_shop_cart_items (0), perch2_shop_countries (248), perch2_shop_currencies (152), perch2_shop_customers (0), perch2_shop_emails (1), perch2_shop_index (112), perch2_shop_option_values (0), perch2_shop_options (0), perch2_shop_order_items (0), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (0), perch2_shop_orders_meta (1), perch2_shop_product_files (0), perch2_shop_product_option_values (0), perch2_shop_product_options (0), perch2_shop_product_tags (0), perch2_shop_products (1), perch2_shop_promotions (0), perch2_shop_search (1), perch2_shop_shipping_zone_countries (1), perch2_shop_shipping_zones (1), perch2_shop_shippings (1), perch2_shop_tax_exhibits (0), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (1), perch2_shop_variants (0), perch2_user_passwords (0), perch2_user_privileges (30), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (1) Users: 1 App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members', 'perch_shop', ); Editor plug-ins: markitup H1: 0562e2115afd0bf92488fdbf4f86be04 L1: b5c5f5ad01f050a5e639f47139f821cf F1: 2edba60ed1f613d6dd804feb202456a2 headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb update_2.8.29: done latest_version: 2.8.15 on_sale_version: 2.8.29 headerScheme: light perch_members_login_page: /members/login.php?r={returnURL} perch_shop_price_tax_mode: exc perch_shop_site_url: https:// perch_shop_product_url: /shop/products/{slug} perch_shop_default_currency: 62 perch_shop_reporting_currency: 62 perch_shop_invoice_number_format: Invoice%d dashboard: 0 hide_pwd_reset: 0 content_hideNonEditableRegions: 0 content_frontend_edit: 0 update_runway_2.8.29: done perch_members_update: 1.4 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: ayzhus1_perch PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: ayzhus1_perch PERCH_DB_PREFIX: perch2_ PERCH_TZ: America/Tijuana PERCH_EMAIL_FROM: onlineservices@ayzh.com PERCH_EMAIL_FROM_NAME: Ayzh Inc PERCH_LOGINPATH: /perch PERCH_PATH: /home/ayzhus1/public_html/perch PERCH_CORE: /home/ayzhus1/public_html/perch/core PERCH_RESFILEPATH: /home/ayzhus1/public_html/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_DEBUG: 1 PERCH_SCHEDULE_SECRET: sthap_everything PERCH_RUNWAY: 1 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_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /home/ayzhus1/public_html/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_PARANOID: PERCH_FORCE_SECURE_COOKIES: PERCH_PASSWORD_MIN_LENGTH: 6 PERCH_MAX_FAILED_LOGINS: 10 PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR PERCH_VERIFY_UPLOADS: PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: PERCH_SESSION_TIMEOUT_MINS: 20 PERCH_APPS_EDITOR_PLUGIN: markitup PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile HOSTING SETTINGS

PHP: 5.5.34 Zend: 2.5.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $ MySQL server: 5.5.5-10.0.25-MariaDB Free disk space: 221.28 GB Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, enchant, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, intl, json, mbstring, mcrypt, standard, mysqlnd, mysqli, mysql, Phar, posix, pspell, Reflection, imap, SimpleXML, snmp, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, PDO, pdo_sqlite, pdo_mysql, imagick, SourceGuardian, ionCube Loader, Zend Guard Loader GD: Yes ImageMagick: Yes PHP max upload size: 16M PHP max form post size: 16M PHP memory limit: 64M Total max uploadable file size: 16M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes PATH: /sbin:/usr/sbin:/bin:/usr/bin PWD: /usr/local/cpanel/cgi-sys SCRIPT_NAME: /perch/core/settings/diagnostics/index.php REQUEST_URI: /perch/core/settings/diagnostics/?extended QUERY_STRING: extended REQUEST_METHOD: GET SERVER_PROTOCOL: HTTP/1.1 GATEWAY_INTERFACE: CGI/1.1 REMOTE_PORT: 15403 SCRIPT_FILENAME: /home/ayzhus1/public_html/perch/core/settings/diagnostics/index.php SERVER_ADMIN: webmaster@ayzh.com CONTEXT_DOCUMENT_ROOT: /home/ayzhus1/public_html REQUEST_SCHEME: http DOCUMENT_ROOT: /home/ayzhus1/public_html REMOTE_ADDR: 189.222.229.149 SERVER_PORT: 80 SERVER_ADDR: 108.163.252.226 SERVER_NAME: www.ayzh.com SERVER_SOFTWARE: Apache LD_LIBRARY_PATH: /usr/local/apache/lib HTTP_COOKIE: cmsa=1; cmssb=1; PHPSESSID=9c5ff7c029b37c964cc53de0828c8a93 HTTP_ACCEPT_LANGUAGE: es,en;q=0.8,en-US;q=0.6 HTTP_ACCEPT_ENCODING: gzip, deflate, sdch HTTP_REFERER: https://www.ayzh.com/perch/core/settings/diagnostics/ HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 HTTP_UPGRADE_INSECURE_REQUESTS: 1 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 HTTP_CONNECTION: close HTTP_HOST: www.ayzh.com UNIQUE_ID: V0MWLWyj-OIAAzkL9y0AAAAH FCGI_ROLE: RESPONDER PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1464014381.39 REQUEST_TIME: 1464014381 argc: 1

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, that table exists. Was the error you're showing us from the page on which you're using perch_shop_products() ?

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ayzhus1/public_html/TSS-new-site/index.php:315) in /home/ayzhus1/public_html/perch/addons/apps/perch_shop/lib/PerchShop_Session.class.php on line 15

Warning: Cannot modify header information - headers already sent by (output started at /home/ayzhus1/public_html/TSS-new-site/index.php:315) in /home/ayzhus1/public_html/perch/addons/apps/perch_shop/lib/PerchShop_Session.class.php on line 34

Drew McLellan

Drew McLellan 2638 points
Perch Support

What's at TSS-new-site/index.php line 315?

<?php perch_shop_products(); ?>

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is this on a Master Page?

is in the index.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

Just a bare index.php in the site? You've not placed your pages under perch/templates/pages ?

nothing, just bare index.php, no master pages or templates, nothing. Im just testing with the standard.

any help?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm asking these questions in an attempt to help!

Can you try creating a master page instead? It's nothing obvious because no one else is reporting this problem - so I can't just give you a magic fix.

I know, I think the problem was on the server side, I had to reinstall all Perch Runway (because before I did just an upgrade) and the Shop App and change the php configuration on my server, so basically that fixed it but I lost some time there... is there a place where I can see the building of a working shop? (the php files). Or a tutorial to finish setting up my store?