Example #1
0
 /**
  * Get the combination url anchor of the product
  *
  * @param int $id_product_attribute
  * @return string
  */
 public function getAnchor($id_product_attribute, $with_id = false)
 {
     $attributes = Product::getAttributesParams($this->id, $id_product_attribute);
     $anchor = '#';
     $sep = Configuration::get('PS_ATTRIBUTE_ANCHOR_SEPARATOR');
     foreach ($attributes as &$a) {
         foreach ($a as &$b) {
             $b = str_replace($sep, '_', Tools::link_rewrite($b));
         }
         $anchor .= '/' . ($with_id && isset($a['id_attribute']) && $a['id_attribute'] ? (int) $a['id_attribute'] . $sep : '') . $a['group'] . $sep . $a['name'];
     }
     return $anchor;
 }
Example #2
0
 /**
  * Get the combination url anchor of the product
  *
  * @param integer $id_product_attribute
  * @return string
  */
 public function getAnchor($id_product_attribute)
 {
     $attributes = Product::getAttributesParams($this->id, $id_product_attribute);
     $anchor = '#';
     foreach ($attributes as &$a) {
         foreach ($a as &$b) {
             $b = str_replace('-', '_', Tools::link_rewrite($b));
         }
         $anchor .= '/' . $a['group'] . '-' . $a['name'];
     }
     return $anchor;
 }
 /**
  * Get the combination url anchor of the product
  *
  * @param integer $id_product_attribute
  * @return string
  */
 public function getAnchor($id_product_attribute)
 {
     $attributes = Product::getAttributesParams($this->id, $id_product_attribute);
     $anchor = '#';
     foreach ($attributes as &$a) {
         foreach ($a as &$b) {
             $b = str_replace(Configuration::get('PS_ATTRIBUTE_ANCHOR_SEPARATOR'), '_', Tools::link_rewrite($b));
         }
         $anchor .= '/' . $a['group'] . Configuration::get('PS_ATTRIBUTE_ANCHOR_SEPARATOR') . $a['name'];
     }
     return $anchor;
 }