Jump to content

[Help] semua produk menghilang dari list...?


63mb3l

Recommended Posts

para sesepuh sekalian ane punya sedikit masalah ni... mohon bantuannya.....

 

semua produk list ane menghilang.... muncul cuman beberapa detik langsung ilang lg.....

 

pas ane cek pake

'display_errors', 'on'

 

ada scritp yg error tp yg aneh nya semua product muncul meskipun warnanya agak memudar kek kena disable gitu....

 

error nya

 

Warning: Invalid argument supplied for foreach() in /home/sebo/public_html/balisilverjewellry.com/prestashop/classes/CompareProduct.php on line 36

 

ini full script CompareProduct.php

 

<?php
class CompareProduct extends ObjectModel
{
public  $id;
public   $id_product;
public   $id_guest;
public   $id_customer;
public   $date_add;
public   $date_upd;
protected  $fieldRequired = array(
 'id_product',
 'id_guest',
 'id_customer');
protected  $fieldsValidate = array(
 'id_product' => 'isUnsignedInt',
 'id_guest' => 'isUnsignedInt',
 'id_customer' => 'isUnsignedInt'
);
protected $table = 'compare_product';
protected $identifier = 'id_compare_product';
/**
 * Get all compare products of the guest
 * @param int $id_guest
 * @return array
 */

public static function getGuestCompareProducts($id_guest)
{
 $results = Db::getInstance()->ExecuteS('
 SELECT DISTINCT `id_product`
 FROM `'._DB_PREFIX_.'compare_product`
 WHERE `id_guest` = '.(int)($id_guest));
 $compareProducts = null;
 foreach($results as $result)
  $compareProducts[] = $result['id_product'];
 return $compareProducts;
}
/**
 * Add a compare product for the guest
 * @param int $id_guest, int $id_product
 * @return boolean
 */
public static function addGuestCompareProduct($id_guest, $id_product)
{
 return Db::getInstance()->Execute('
  INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_guest`, `date_add`, `date_upd`)
  VALUES ('.(int)($id_product).', '.(int)($id_guest).', NOW(), NOW())
 ');
}
/**
 * Remove a compare product for the guest
 * @param int $id_guest, int $id_product
 * @return boolean
 */
public static function removeGuestCompareProduct($id_guest, $id_product)
{
 return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'compare_product` WHERE `id_guest` = '.(int)($id_guest).' AND `id_product` = '.(int)($id_product));
}
/**
 * Get the number of compare products of the guest
 * @param int $id_guest
 * @return int
 */
public static function getGuestNumberProducts($id_guest)
{
 return (int)(Db::getInstance()->getValue('
  SELECT count(`id_compare_product`)
  FROM `'._DB_PREFIX_.'compare_product`
  WHERE `id_guest` = '.(int)($id_guest)));;
}
/**
 * Get all comapare products of the customer
 * @param int $id_customer
 * @return array
 */
public static function getCustomerCompareProducts($id_customer)
{
 $results = Db::getInstance()->ExecuteS('
 SELECT DISTINCT `id_product`
 FROM `'._DB_PREFIX_.'compare_product`
 WHERE `id_customer` = '.(int)($id_customer));
 $compareProducts = null;
 foreach($results as $result)
  $compareProducts[] = $result['id_product'];
 return $compareProducts;
}
/**
 * Add a compare product for the customer
 * @param int $id_customer, int $id_product
 * @return boolean
 */
public static function addCustomerCompareProduct($id_customer, $id_product)
{
  return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_customer`, `date_add`, `date_upd`) VALUES ('.(int)($id_product).', '.(int)($id_customer).', NOW(), NOW())');
}
/**
 * Remove a compare product for the customer
 * @param int $id_customer, int $id_product
 * @return boolean
 */
public static function removeCustomerCompareProduct($id_customer, $id_product)
{
 return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'compare_product` WHERE `id_customer` = '.(int)($id_customer).' AND `id_product` = '.(int)($id_product));
}
/**
 * Get the number of compare products of the customer
 * @param int $id_customer
 * @return int
 */
public static function getCustomerNumberProducts($id_customer)
{
 return (int)(Db::getInstance()->getValue('
  SELECT count(`id_compare_product`)
  FROM `'._DB_PREFIX_.'compare_product`
  WHERE `id_customer` = '.(int)($id_customer)));
}
/**
 * Clean entries which are older than the period
 * @param string $period
 * @return void
 */
public static function cleanCompareProducts($period = 'week')
{
 if ($period === 'week')
  $interval = '1 WEEK';
 elseif ($period === 'month')
  $interval = '1 MONTH';
 elseif ($period === 'year')
  $interval = '1 YEAR';
 else
  return;
 if ($interval != null)
 {
  Db::getInstance()->Execute('
  DELETE FROM `'._DB_PREFIX_.'compare_product`
  WHERE date_upd < DATE_SUB(NOW(), INTERVAL '.pSQL($interval).')');
 }
}
}

 

 

Ini TKP nya

 

ane pake ps 1440 sm 1441 hasil nya sama.....

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...