Jump to content

Contenu du module de vente privée sur la home


Recommended Posts

  • 2 months later...

Bonjour,

j'ai refais des test, je n'ai plus de page blanche... par contre il n'y a aucun changement  :huh: .

J'ai bien vidé le cache... mais rien n'y fait.

Il faut dire que c'est la première fois que je fait des modifs de ce genre donc j'ai surement raté un truc.

Voici ce que j'ai collé dans privatsale.php :

Si tu pouvais me filer un coup de main sur ce coup là, se serai vraiment top !!

Encore merci. 

public function hookDisplayHome()

	{

		global $smarty, $cookie;

		

		if (isset($_GET['register']) && is_numeric($_GET['register']))

		{

			$sale_ret =	$this->PvSaleRegister($cookie->id_customer, $_GET['register']);

			$sale_ret == FALSE ? $smarty->assign('register', 0) : $smarty->assign('register', 1);

		}

		

		$pvs = new privatesale();

		$pvs_list = $pvs->getPvSaleList(1);

		if (!empty($pvs_list))

		{

			$pvs_result[0] = array();

			$pvs_result[1] = array();

			$pvs_result[2] = array();

			

			$now = time();

			foreach($pvs_list as $temp)

			{

				$access = 0;

				$grp_agree = explode(',', $temp['groups']);

				foreach($grp_agree as $grp_tmp)

				{

					$check = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'customer_group WHERE id_customer="'.$cookie->id_customer.'" AND id_group="'.$grp_tmp.'"');

					if ($check != FALSE)

						$access = 1;

				}

				

				if ($access == 1)

				{

					$temp['status'] = $this->getSaleStatus($temp['time_start'], $temp['time_end']);

					($this->CheckSaleRegister((int)$cookie->id_customer, (int)$temp['id']) == FALSE) ? $temp['access'] = 0 : $temp['access'] = 1;

					$temp['link'] = Context::getContext()->link->getModuleLink('privatesale', 'pvprods', array("id" => $temp['id']));

					$temp['register'] = Context::getContext()->link->getModuleLink('privatesale', 'pvlist', array("register" => $temp['id']));					

					if (file_exists(__PS_BASE_URI__."modules/privatesale/public/img/".(int)$temp['id'].".jpg"));

						$temp['file_exists'] = __PS_BASE_URI__."modules/privatesale/public/img/".(int)$temp['id'].".jpg";

					$pvs_result[$temp['status'] - 1][] = $temp;

				}

			}



			$list = array();

			foreach($pvs_result[1] as $temp1)

				$list[] = $temp1;

			foreach($pvs_result[0] as $temp2)

				$list[] = $temp2;

			foreach($pvs_result[2] as $temp3)

				$list[] = $temp3;

			

			$this->context->smarty->assign('pvs_list', $list);

		}

		$this->context->smarty->assign('pv_cookie', $cookie);

		

		$this->setTemplate('pvlist.tpl');

	}
Link to comment
Share on other sites

  • 4 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...