Forums / All Other Contributions/Addons / Stock By Attribute - Product disappears from website once variants are created

Stock By Attribute - Product disappears from website once variants are created

Views: 1,759

Results 1 to 20 of 24
26 Mar 2016, 5:26 PM
#1
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Stock By Attribute - Product disappears from website once variants are created

Hi,

I am using Stock By Attribute (SBA) Stock Page Version 1.5.4

Once I have created the variants for a product, the product disappears from my website :dontgetit I delete the variants and my product shows on my website again.

27 Mar 2016, 8:50 PM
#2
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

When I search for the item it's there but once you click on it, it goes to just a white page.

27 Mar 2016, 9:34 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Stock By Attribute - Product disappears from website once variants are created

enchanted1:

it goes to just a white page.
See http://www.zen-cart.com/content.php?124-blank-page

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 Mar 2016, 11:14 PM
#4
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

I was incorrect, the whole page isn't white, just where the product is supposed to be. Anyway, the only php error I'm getting in the log is in the includes/extra_configures/set_time_zone.php

29 Mar 2016, 11:43 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

enchanted1:

I was incorrect, the whole page isn't white, just where the product is supposed to be.

Meaning, the header, sideboxes (left AND right if normally present) and footer all display, but zero information is presented in the center area about the product? Or is it just the attributes part that is "missing"?

Ie. How about a link to the affected page(s)?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

30 Mar 2016, 12:18 AM
#6
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Stock By Attribute - Product disappears from website once variants are created

Might be obvious, but maybe double check to make sure all files were uploaded and into the correct place and any merged files have all of the code correctly merged and in the right places. Sounds like a problem in either the product info display logic file or the template file, my guess is the template.


Zen Cart and it's community are the best!!

30 Mar 2016, 12:32 AM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

lankeeyankee:

Might be obvious, but maybe double check to make sure all files were uploaded and into the correct place and any merged files have all of the code correctly merged and in the right places. Sounds like a problem in either the product info display logic file or the template file, my guess is the template.

To take that a step further, depending on the source of the SBA code obtained, there are four files that come to mind affecting the product page. Two template files, a modules file, and an observer file. One of the template files is associated with the product image (often one of the earlier template files loaded) the rest address the attributes. Most templates display the attributes after much of the other product info, but that sequence can be anything "desired".

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2016, 1:39 PM
#8
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

Thank you for responding, I haven't checked anything yet but after reading what you wrote 'any merged files have all of the code correctly merged', I believe that will be my problem, I never merged and I remember overwriting a file or two. :(

Today I had a customer purchase an attribute item (I didn't use the SBA for it) and when I go to the order page, in the product section it says WARNING: An Error occurred, please refresh the page and try again. And the rest of the page is missing. I looked in my error log but nothing is listed for today. Ugh!

2 Apr 2016, 2:19 PM
#9
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

I also ran the sba check file script and it came back no error reported.

2 Apr 2016, 2:48 PM
#10
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

I'm going to back up my website and then reinstall all of the sba files.

2 Apr 2016, 5:32 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

enchanted1:

I also ran the sba check file script and it came back no error reported.

That check verifies that files of the correct filename are stored where expected and if I remember verifies the presence of some functions. It does not do some sort of line-by-line review or function response testing. So that does indicate that the files made it, but it doesn't validate that everything works as expected.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2016, 5:38 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

enchanted1:

Thank you for responding, I haven't checked anything yet but after reading what you wrote 'any merged files have all of the code correctly merged', I believe that will be my problem, I never merged and I remember overwriting a file or two. :(

Today I had a customer purchase an attribute item (I didn't use the SBA for it) and when I go to the order page, in the product section it says WARNING: An Error occurred, please refresh the page and try again. And the rest of the page is missing. I looked in my error log but nothing is listed for today. Ugh!

This is typical of one or more of the following issues, either the includes/configure.php or at least in this case the admin/includes/configure.php direct DIR_FS_LOGS to an incorrect location, the location is "correctly" identified, but doesn't exist, or the location is not writeable. Often this is easiest to troubleshoot by posting the contents of each of these files, but obscuring the credentials for accessing the database (DB_PASSWORD for example) and if the specific directory name for your admin is included to obscure it as well.

Please just before pasting the contents, click the # button in the messagebox toolbar to generate ```
[CODE] and [/CODE]

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2016, 5:40 PM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

enchanted1:

I'm going to back up my website and then reinstall all of the sba files.

If you haven't obtained the SBA files from https://github.com/mc12345678/Stock_By_Attributes_Combined, please do so. This is the latest functional version and even works on ZC 1.5.5 or at least has for those that have tested it.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2016, 8:18 PM
#14
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

This is includes/configure.php:

<?php
/**
 * @package Configuration Settings circa 1.3.9
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * File Built by zc_install on 2010-05-14 06:40:53
 */


/*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/
/***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/

// Define the webserver and path parameters
  // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
  // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
  define('HTTP_SERVER', 'http://enchantedcottageshop.com');
  define('HTTPS_SERVER', 'https://enchantedcottageshop.com');

  // Use secure webserver for checkout procedure?
  define('ENABLE_SSL', 'true');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_CATALOG', '/shop/');
  define('DIR_WS_HTTPS_CATALOG', '/shop/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
  define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

  define('DIR_WS_PHPBB', '/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_CATALOG', '/home/theenc/public_html/shop/');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
  define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
  define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', '');
  define('DB_SERVER_PASSWORD', '');
  define('DB_DATABASE', 'theenc_zc1');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'db');
  // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
  define('SQL_CACHE_METHOD', 'none'); 
  define('DIR_FS_SQL_CACHE', '/home/theenc/public_html/shop/cache');

// EOF
2 Apr 2016, 8:21 PM
#15
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

This is my admin/includes/configure.php:

<?php
/**
 * @package Configuration Settings circa 1.3.9
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * File Built by zc_install on 2010-05-14 06:40:53
 */


/*************** NOTE: This file is similar, but DIFFERENT from the "store" version of configure.php. ***********/
/***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/

// Define the webserver and path parameters
  // Main webserver: eg-http://www.your_domain.com - 
  // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
  // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
  // HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.your_domain.com
  // HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.your_domain.com
  /* 
   * URLs for your site will be built via:  
   *     HTTP_SERVER plus DIR_WS_ADMIN or
   *     HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or 
   *     HTTP_SERVER plus DIR_WS_CATALOG or 
   *     HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG
   * ...depending on your system configuration settings
   *
   * If you desire your *entire* admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
   */
  define('HTTP_SERVER', 'https://enchantedcottageshop.com');
  define('HTTPS_SERVER', 'https://enchantedcottageshop.com');
  define('HTTP_CATALOG_SERVER', 'https://enchantedcottageshop.com');
  define('HTTPS_CATALOG_SERVER', 'https://enchantedcottageshop.com');

  // Use secure webserver for catalog module and/or admin areas?
  define('ENABLE_SSL_CATALOG', 'true');
  define('ENABLE_SSL_ADMIN', 'true');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_ADMIN', '/shop//');
  define('DIR_WS_CATALOG', '/shop/');
  define('DIR_WS_HTTPS_ADMIN', '/shop//');
  define('DIR_WS_HTTPS_CATALOG', '/shop/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
  define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_ADMIN', '/home/theenc/public_html/shop//');
  define('DIR_FS_CATALOG', '/home/theenc/public_html/shop/');

  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', '');
  define('DB_SERVER_PASSWORD', '');
  define('DB_DATABASE', 'theenc_zc1');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'db');
  // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
  define('SQL_CACHE_METHOD', 'none'); 
  define('DIR_FS_SQL_CACHE', '/home/theenc/public_html/shop/cache');

// EOF
2 Apr 2016, 10:20 PM
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

So, couple of things, though perhaps one of the issues is because of deleting the admin folder name.

So, looks like may have followed the instructions of one of the "older" ways to upgrade as the configure.php files show as being created in ZC 1.3.9... There was a method presented (at least one I typically use) at: http://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading

But, that part is over now, so let's move on. My suggestion at this point would be to go into each of the includes directories, look for a file similar to dist-configure.php... Copy that file to another name (local server/computer would be preferred/easier), then in the new file "fill in the blanks"... Yes your old file does/will have things the new file doesn't, yes they are in a different order, but this way at least on the admin side you will never need to obscure your admin directory again, renaming your admin directory only requires a file folder rename, etc...
Then after the rework, make a backup copy of your live site's version (rename?), and place the new ones on the server. Check operation of both sides.

So the other thing(s), assuming you don't rebuild the files, in the admin version, I see that the path for DIR_FS_ADMIN ends with // (might be because the actual admin foldern ame was removed).

In both files, the following or similar is missing:

define('DIR_FS_LOGS', '/home/theenc/public_html/shop/logs');

Verify that you have a logs folder at that location and that the permissions are either 777 or maybe 755 on the folder. If you must create the folder, suggest obtaining the files that should be inside of it from a vanilla install/download available from the main page of this forum site.

I'll take a look also and see if I can't type in the recommended version, if the above doesn't "work".

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2016, 10:28 PM
#17
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

Now as to the observed issue(s). This is more than likely a result of how this (SBA) was installed and how the few changes to the core files (not overrideable) were merged (or not) with files modified by other plugins. This is not to say that they can't all work together, but the code to support each does need to be present for them all to work/provide the intended result(s).

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Apr 2016, 10:57 PM
#18
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

In both files, the following or similar is missing:

define('DIR_FS_LOGS', '/home/theenc/public_html/shop/logs');

> 
> Verify that you have a logs folder at that location and that the permissions are either 777 or maybe 755 on the folder. If you must create the folder, suggest obtaining the files that should be inside of it from a vanilla install/download available from the main page of this forum site.

Yes the logs folder is there and is 755.  It's probably irrelevant to my problem but it keeps giving me the same error message:

PHP Warning:  Invalid argument supplied for foreach() in /home/theenc/public_html/shop/includes/templates/elegancer/common/tpl_header.php on line 150
2 Apr 2016, 11:16 PM
#19
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Stock By Attribute - Product disappears from website once variants are created

enchanted1:

Yes the logs folder is there and is 755. It's probably irrelevant to my problem but it keeps giving me the same error message:

PHP Warning: Invalid argument supplied for foreach() in /home/theenc/public_html/shop/includes/templates/elegancer/common/tpl_header.php on line 150

Is that the extent of the warning message? If that is all there is, may I suggest installing lat9's mydebug backtrace so that the initiating offender might be locateable?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Apr 2016, 3:24 PM
#20
enchanted1 avatar

enchanted1

New Zenner

Join Date:
Aug 2012
Location:
Kitty Hawk, NC
Posts:
70
Plugin Contributions:
0

Re: Stock By Attribute - Product disappears from website once variants are created

Because I was having problems with the SBA add on, I went ahead and removed it and everything is back to normal. Maybe there is another one I can try? I don't mind paying for it, if it will work better for me :smile: