Jump to content

yaayhai

Members
  • Posts

    3
  • Joined

  • Last visited

1 Follower

Profile Information

  • First Name
    santhose
  • Last Name
    kumar

yaayhai's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. This is My Business Logic, Can you Suggest Me the best way to do, I am developing Prestashop for my company, which has two different warehouse with different Manufacturing unit, We are selling the product in a single store in prestashop. My Requirement is if a product is available in Warehouse A, i need to show only the Different carrier in warehouse A,or a product is available in Warehouse B, i need to show only the Different carrier in warehouse B, if the product is available in both warehouse i need to display both carrier, and if a customer choose Product A from warehouse A as well as Product B from Warehouse B, How can i show multiple shipment operation and option
  2. My Requirement is to Have the Custom ordering Field which is discdribed Super order, which should display in subcategory page only at Bottom, Where the user must select the Product and corresponding attribute, i have framed the function, and strucked in where i need to use like overriding previous controller or else need to create new module or for you reference, /*To get Product Name, id & category id */ public function fastor($fastid){ $db = Db::getInstance(); $sql = 'SELECT p.id_product AS id, pl.name, p.id_category_default AS cid FROM '._DB_PREFIX_.'_product p INNER JOIN '._DB_PREFIX_.'product_lang pl ON p.id_product = pl.id_product WHERE pl.id_lang=1 AND pl.id_shop='.$lang.' AND p.id_category_default='.$fastid.''; $resu = Db::getInstance()->ExecuteS($sql); $smarty->assign('array',$resu); return $this->display(__FILE__, 'footer.tpl'); $rea = $resu[id]; $reb = $resu[name]; $rec = $resu[cid]; return $rea; return $reb; return $rec; } /*To get Main category id & Name*/ public function quiccat(){ $db = Db::getInstance(); $att ='SELECT p.id_category, pl.name FROM '._DB_PREFIX_.'_category p INNER JOIN '._DB_PREFIX_.'_category_lang pl ON p.id_category = pl.id_category WHERE pl.id_lang=1 AND pl.id_shop=1 AND p.id_parent=2'; $rescv = Db::getInstance()->ExecuteS($att); $atta=$att[id_category]; $attb=$att[name]; } /*To get Sub category id & Name of the Selected Main category*/ public function quicsubcat($hmecat){ $db = Db::getInstance(); $atti ='SELECT p.id_category, pl.name FROM '._DB_PREFIX_.'_category p INNER JOIN '._DB_PREFIX_.'_category_lang pl ON p.id_category = pl.id_category WHERE pl.id_lang=1 AND pl.id_shop=1 AND p.id_parent='.$hmecat.''; $resv = Db::getInstance()->ExecuteS($atti); $attia=$att[id_category]; $attia=$att[name]; } /*To fetch selected Product Attributes*/ public function productAttributeExists($attributes_list, $current_product_attribute = false, Context $context = null, $all_shops = false, $return_id = false) { if (!Combination::isFeatureActive()) return false; if ($context === null) $context = Context::getContext(); $result = Db::getInstance()->executeS( 'SELECT pac.`id_attribute`, pac.`id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` pa JOIN `'._DB_PREFIX_.'product_attribute_shop` pas ON (pas.id_product_attribute = pa.id_product_attribute) LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`) WHERE 1 '.(!$all_shops ? ' AND pas.id_shop ='.(int)$context->shop->id : '').' AND pa.`id_product` = '.(int)$this->id. ($all_shops ? ' GROUP BY pac.id_attribute, pac.id_product_attribute ' : '') ); /* If something's wrong */ if (!$result || empty($result)) return false; /* Product attributes simulation */ $product_attributes = array(); foreach ($result as $product_attribute) $product_attributes[$product_attribute['id_product_attribute']][] = $product_attribute['id_attribute']; /* Checking product's attribute existence */ foreach ($product_attributes as $key => $product_attribute) if (count($product_attribute) == count($attributes_list)) { $diff = false; for ($i = 0; $diff == false && isset($product_attribute[$i]); $i++) if (!in_array($product_attribute[$i], $attributes_list) || $key == $current_product_attribute) $diff = true; if (!$diff) { if ($return_id) return $key; return true; } } return false; } Suggest Me how to add tpl for this, need to override in Footer.tpl file,
×
×
  • Create New...