Jump to content

Claudia M

Member
  • Posts

    847
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by Claudia M

  1. All 3 are in there redo_start => "" start => "" begin => " and end_expire => ""
  2. I created a new column name - begin - with different attributes: as defined, to see if a fresh start would help the null stuff on the product inventory page. It didn't. Null still shows on that page - null doesn't show on the actual product general information page
  3. If I go into the actual edit the product page and put a space in the redo / Start box then it clears on the Product Inventory page - null gone; now blank. So I think this is probably the best that can be done.
  4. I have the popup but I'm not sure what you are looking for Found it: begin => "" (originally redo_start but I changed it)
  5. The field is blank. Maybe on the Product Inventory page it has to show Null for some reason? Maybe my coding: <th nowrap="nowrap">{$THEAD.redo_start}</th> <td><span class="editable number" name="product[{$product.product_id}][redo_start]">{$product.redo_start}</span></td> <div><label for="redo_start">Redid / Start Date</label><span><input name="redo_start" id="redo_start" class="textbox number" type="text" value="{$PRODUCT.redo_start}" /></span></div>
  6. It is empty in the textbox on the actual product general information page. But it shows null on the product inventory page. This is where I want it blank. I'll look at what you just posted.
  7. I created a new one with default as defined and left it blank. Null still shows. Cleared the database and regular caches
  8. I tried that and the nulls remained. Maybe it doesn't automatically update? I'll create a new one with as defined and see what that does
  9. I don't know why the image posted so many times. Default column gives the following options: None (Will that show the word none - or leave it blank?) As defined: ( then you get the box) Null Current_timestamp
  10. This is what I have for redo_start. It still shows null on the product page even after clearing the caches. I tried the default "as defined" and left the box next to it blank. Still showed null. I haven't really started populating that field so if I have to setup a new one other that redo_start I can.
  11. what would the query be? Will it automatically change the product page to be blank or will I have to delete each null? I don't think the differences will matter to me.
  12. I have setup a few new columns fields whatever they are called) in the inventory table. Right now they show null if no data is added by my. Is there a way to just have it blank until I add the info? Not all products will have all the information. I must have set it up wrong Thanks in advance,
  13. Did above and the test worked. I'm beginning to think it really was something I did and somehow corrected when I uploaded the edited file.
  14. These are the only changes between the original 6.4.3 classes.catalogue.class.php file and my file. The stock level works using my changes. I thought you had mentioned others having this problem. Do you see anything in the original code that may cause the problem? 6.4.3 Line 71 { $pre_release = $GLOBALS['db']->select('CubeCart_inventory', 'MIN(`live_from`) AS `next_time`', '`live_from` > UNIX_TIMESTAMP()', false, 1, false, false); if(!is_null($pre_release[0]['next_time'])) { $this->_where_live_from = ' AND `live_from` < UNIX_TIMESTAMP() '; } } MINE { if($pre_release = $GLOBALS['db']->select('CubeCart_inventory', 'MIN(`live_from`) AS `next_time`', '`live_from` > UNIX_TIMESTAMP()', false, 1, false, false)) { $this->_where_live_from = ' AND `live_from` < UNIX_TIMESTAMP() '; } } 6.4.3 Line 406 } $skin_data = GUI::getInstance()->getSkinData(); foreach ($reviews as $review) { MINE } foreach ($reviews as $review) { 6.4.3 Line 415 $review['gravatar'] = md5(strtolower(trim($review['email']))); if($skin_data['info']['gravatar_ajax']) { $review['gravatar_exists'] = true; } else { $gravatar_url = 'gravatar.com'; $gravatar_path = '/avatar/'.$review['gravatar'].'?d=404&r=g'; $review['gravatar_src'] = 'https://'.$gravatar_url.$gravatar_path; $request = new Request($gravatar_url, $gravatar_path, 443, true, false, 3, true); $request->skiplog(true); $request->setMethod('get'); $request->cache(true); $request->customOption(CURLOPT_NOBODY, true); $request->setSSL(); ob_start(); $request->send(); $result = ob_get_contents(); ob_end_clean(); $review['gravatar_exists'] = $result ? true : false; } } else { $review['gravatar_exists'] = false; MINE $review['gravatar'] = md5(strtolower(trim($review['email']))); $review['gravatar_src'] = 'https://www.gravatar.com/avatar/'.$review['gravatar'].'?d=404&r=g'; $headers = get_headers($review['gravatar_src']); $review['gravatar_exists'] = strstr($headers[0], '200') ? true : false; } else { $review['gravatar_exists'] = false; 6.4.3 Line 415 $GLOBALS['gui']->addBreadcrumb($product['name'], currentPage()); } // Output to main GUI MINE $GLOBALS['gui']->addBreadcrumb($product['name'], currentPage()); } // Start SemperFi Modification if($GLOBALS['config']->get('config','sfws_related_products_status_product_pages') == 1){ if($GLOBALS['config']->get('config','sfws_related_products_amount_product_pages')){ $rp_limit = $GLOBALS['config']->get('config','sfws_related_products_amount_product_pages'); } else { $rp_limit = 3; } if(($GLOBALS['config']->get('config','sfws_related_products_status_hide_oos_options') == 3 && $GLOBALS['config']->get('config', 'hide_out_of_stock')) || $GLOBALS['config']->get('config','sfws_related_products_status_hide_oos_options') == 1) { // Always hidden or CubeCart says to hide $stock_where_manual = " AND ((I.use_stock_level = '0') OR (I.use_stock_level = '1' AND I.stock_level > 0))"; } $seed = mt_rand(1, 10000); $related_products_type = ''; $get_related_products_manual_query = "SELECT R.related_product_id, I.* FROM ".$GLOBALS['config']->get('config','dbprefix')."CubeCart_related_products AS R INNER JOIN ".$GLOBALS['config']->get('config', 'dbprefix')."CubeCart_inventory AS I ON R.related_product_id = I.product_id WHERE R.main_product_id = ".$product['product_id']." AND I.status = 1 AND I.available != 0 ".$stock_where_manual." ORDER BY RAND(".$seed.") LIMIT ".$rp_limit; $related_products_manual = $GLOBALS['db']->query($get_related_products_manual_query); if ($related_products_manual){ $related_products = $related_products_manual; $related_products_type = 'Manual'; } else { if($GLOBALS['config']->get('config','sfws_related_products_status_product_pages_random') == 1){ if(($GLOBALS['config']->get('config','sfws_related_products_status_hide_oos_options') == 3 && $GLOBALS['config']->get('config', 'hide_out_of_stock')) || $GLOBALS['config']->get('config','sfws_related_products_status_hide_oos_options') == 1) { // Always hidden or CubeCart says to hide $stock_where_auto = " AND ((use_stock_level = '0') OR (use_stock_level = '1' AND stock_level > 0))"; } $get_related_products_auto_query = "SELECT * FROM ".$GLOBALS['config']->get('config', 'dbprefix')."CubeCart_inventory WHERE product_id != ".$product['product_id']." AND cat_id = ".$product['cat_id']." AND status = 1 AND available != 0 ".$stock_where_auto." ORDER BY RAND(".$seed.") LIMIT ".$rp_limit; $related_products_auto = $GLOBALS['db']->query($get_related_products_auto_query); if ($related_products_auto){ $related_products = $related_products_auto; $related_products_type = 'Auto'; } } } if ($related_products) { foreach ($related_products as $related_product) { if($related_products_type == "Manual"){ $related_product['related_product_id'] = $related_product['related_product_id']; } else { $related_product['related_product_id'] = $related_product['product_id']; } $category_data = $GLOBALS['catalogue']->getCategoryStatusByProductID($related_product['related_product_id']); $category_status = false; if (is_array($category_data)) { foreach ($category_data as $trash => $data) { if ($data['status'] == 1) { $category_status = true; } } } if (!$category_status) { continue; } $GLOBALS['language']->translateProduct($related_product); $related_product['image'] = $GLOBALS['gui']->getProductImage($related_product['product_id'], 'small'); $related_product['ctrl_sale'] = (!$GLOBALS['tax']->salePrice($related_product['price'], $related_product['sale_price']) || !$GLOBALS['config']->get('config', 'catalogue_sale_mode')) ? false : true; $GLOBALS['catalogue']->getProductPrice($related_product); $related_product_sale = $GLOBALS['tax']->salePrice($related_product['price'], $related_product['sale_price']); $related_product['price_unformatted'] = $related_product['price']; $related_product['sale_price_unformatted'] = ($related_product_sale) ? $related_product['sale_price'] : null; $related_product['price'] = $GLOBALS['tax']->priceFormat($related_product['price']); $related_product['sale_price'] = ($related_product_sale) ? $GLOBALS['tax']->priceFormat($related_product['sale_price']) : null; $related_product['ctrl_stock'] = (!$related_product['use_stock_level'] || $GLOBALS['config']->get('config', 'basket_out_of_stock_purchase') || ($related_product['use_stock_level'] && $GLOBALS['catalogue']->getProductStock($related_product['product_id'], null, true))) ? true : false; $related_product['url'] = $GLOBALS['seo']->buildURL('prod', $related_product['product_id'], '&amp;'); $varsRelatedProducts[] = $related_product; } $GLOBALS['smarty']->assign('RELATED_PRODUCTS_TYPE', $related_products_type); $GLOBALS['smarty']->assign('RELATED_PRODUCTS', $varsRelatedProducts); } } // End SemperFi Modification // Output to main GUI 6.4.3 Line 755 public function getCategoryProducts($category_id, $page = 1, $per_page = 10, $hidden = false) { if (strtolower($page) == 'all') { $per_page = false; $page = false; } $where2 = $this->outOfStockWhere(false, 'INV', true); if (($result = $GLOBALS['db']->query('SELECT I.product_id FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_category_index` as I, `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` as INV WHERE I.cat_id = '.$category_id.' AND I.product_id = INV.product_id AND INV.status = 1'.$where2)) !== false) { $this->_category_count = $GLOBALS['db']->numrows(); MINE public function getCategoryProducts($category_id, $page = 1, $per_page = 10, $hidden = false) { if (strtolower($page) == 'all') { $per_page = false; $page = false; } // START My do not show product on Cat Page if Sold $where = " AND INV.available = '1'"; $where2 = $this->outOfStockWhere(false, 'INV', true); if (($result = $GLOBALS['db']->query('SELECT I.product_id FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_category_index` as I, `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` as INV WHERE I.cat_id = '.$category_id.' AND I.product_id = INV.product_id AND INV.status = 1'.$where.$where2)) !== false) { // END My do not show product on Cat Page if Sold $this->_category_count = $GLOBALS['db']->numrows(); 6.4.3 Line 1059 $where = $this->outOfStockWhere(array('product_id' => $product_id, 'status' => 1)); if (is_array($order) && isset($order['price']) && $GLOBALS['config']->get('config', 'catalogue_sale_mode')) { $query = 'SELECT *, IF(`sale_price`> 0 AND `sale_price` < `price`,`sale_price`,`price`) AS `price_sort` FROM '.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory WHERE '.$where.' ORDER BY `price_sort` '.$order['price']; if (!empty($page) && is_numeric($page)) { $query = $query.' LIMIT '.$per_page.' OFFSET '.(int)($page-1)*$per_page; } $result = $GLOBALS['db']->query($query); } else { MINE $where = $this->outOfStockWhere(array('product_id' => $product_id, 'status' => 1)); if (is_array($order) && isset($order['price']) && $GLOBALS['config']->get('config', 'catalogue_sale_mode')) { if (!empty($page) && is_numeric($page)) { $query = 'SELECT *, IF(`sale_price` > 0, `sale_price`, `price`) AS price_sort FROM '.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory WHERE '.$where.' ORDER BY `price_sort` '.$order['price'].' LIMIT '.$per_page.' OFFSET '.(int)($page-1)*$per_page; } else { $query = 'SELECT *, IF(`sale_price` > 0, `sale_price`, `price`) AS price_sort FROM '.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory WHERE '.$where.' ORDER BY `price_sort` '.$order['price']; } $result = $GLOBALS['db']->query($query); } else { 6.4.3 Line 1843 foreach($manufacturers as $manufacturer) { $ids[] = $manufacturer['id']; } $manufacturers = implode(',',$ids); $where[] = "AND `I`.`manufacturer` IN($manufacturers)"; } MINE foreach($manufacturers as $manufacturer) { $ids[] = $manufacturer['id']; } $manufacturers = implode(',',$ids); $where[] = "OR `I`.`manufacturer` IN($manufacturers)"; }
  15. I keep a copy of all the files I edit along with two copies of the current Foundation skin one for edits, one orginal for no edits. Just for the heck of it I uploaded my class/catalogue.class file from my edited file (Not from the foundation skin). I then ran the stock level test again and it worked!! Tomorrow I'm going to compare the files and see what the heck the difference was!!!
  16. I didn't notice this happening until CC 6.4.3. Must be something in there?
  17. By the by - I didn't upgrade to 6.4.4. just applied the security patch. ok got debug enabled. Got 135 errors in admin error log including: [<strong>Notice</strong>] /home/claudias/public_html/classes/catalogue.class.php:462 - Logging the product stock level for SCO-2000 as 2 https://www.claudiasbargains.com/baby-powder-scented-fragrance-oil.html Got this in red: Hack: 1626478097.53770 --- Duration: 21389 ┬Ás [ERROR - NOT CACHED] INSERT INTO `CubeCart_system_error_log` (`message`,`url`,`backtrace`,`time`) VALUES ('[<strong>Notice</strong>] /home/claudias/public_html/classes/catalogue.class.php:462 - Logging the product stock level for SCO-2000 as 3','https://www.claudiasbargains.com/baby-powder-scented-fragrance-oil.html','trigger_error() (catalogue.class.php:462)\ndisplayProduct() (cubecart.class.php:2898)\n_product() (cubecart.class.php:462)\nloadPage() (controller.index.inc.php:90)\ninclude() (index.php:20)\n','1626478097'); in cpanel lines 297-301 at bottom: [16-Jul-2021 19:33:15 America/Louisville] PHP Notice: Undefined variable: find_prev_next_prod_id in /home/claudias/public_html/modules/plugins/PrevNext/hooks/class.catalogue.productassign.php on line 26 [16-Jul-2021 19:33:15 America/Louisville] PHP Notice: Trying to access array offset on value of type null in /home/claudias/public_html/modules/plugins/PrevNext/hooks/class.catalogue.productassign.php on line 26 [16-Jul-2021 19:33:15 America/Louisville] PHP Notice: Undefined variable: find_prev_next_prod_id in /home/claudias/public_html/modules/plugins/PrevNext/hooks/class.catalogue.productassign.php on line 27 [16-Jul-2021 19:33:15 America/Louisville] PHP Notice: Trying to access array offset on value of type null in /home/claudias/public_html/modules/plugins/PrevNext/hooks/class.catalogue.productassign.php on line 27 [16-Jul-2021 19:33:15 America/Louisville] PHP Notice: Logging the product stock level for TLS-5500 as 1 in /home/claudias/public_html/classes/catalogue.class.php on line 462 Iine 229 [16-Jul-2021 19:25:02 America/Louisville] PHP Notice: Logging the product stock level for SCO-2000 as 2 in /home/claudias/public_html/classes/catalogue.class.php on line 462 Line 267 [16-Jul-2021 19:27:37 America/Louisville] PHP Notice: Logging the product stock level for SCO-2000 as 3 in /home/claudias/public_html/classes/catalogue.class.php on line 462
  18. The stock levels agreed at first. Changed the stock level in admin to 2 without clearing the cache and the stock level showed 2 in admin but the original 3 on the product page. No errors in the admin error logs. cPanel error log shows 173 lines
  19. No plugins or code snippets that directly affect stock levels. Did you look at my code above and see if my modifications could have caused it. I might have done something wrong. The stock level does change in admin - just not the store front unless I clear the cache
  20. No I don't use options. Could this have anything to do with the minimum maximum quantity to purchase added in 6.4.3? So are you saying for now until a solution is found I just need to keep on top of clearing my cache? How will I know a solution is found. Did my code look ok to you.
×
×
  • Create New...