Exemplo n.º 1
0
 /**
  * Return products data to show
  *
  * @param string $format
  * @return array
  */
 function toArray($format = 's')
 {
     $ret = array();
     $ret = parent::toArray($format);
     $myshop_Currency = myshop_Currency::getInstance();
     $ret['product_price_formated'] = $myshop_Currency->amountForDisplay($this->getVar('product_price'));
     $ret['product_shipping_price_formated'] = $myshop_Currency->amountForDisplay($this->getVar('product_shipping_price'));
     $ret['product_discount_price_formated'] = $myshop_Currency->amountForDisplay($this->getVar('product_discount_price'));
     $ret['product_price_ttc'] = $myshop_Currency->amountForDisplay($this->getTTC());
     $ret['product_ecotaxe_formated'] = $myshop_Currency->amountForDisplay($this->getVar('product_ecotaxe'));
     if (intval($this->getVar('product_discount_price')) != 0) {
         $ret['product_discount_price_ttc'] = $myshop_Currency->amountForDisplay($this->getDiscountTTC());
     } else {
         $ret['product_discount_price_ttc'] = '';
     }
     $ret['product_tooltip'] = myshop_utils::makeInfotips($this->getVar('product_description'));
     $ret['product_url_rewrited'] = $this->getLink();
     $ret['product_href_title'] = myshop_utils::makeHrefTitle($this->getVar('product_title'));
     $ret['product_recommended'] = $this->isRecommended();
     $ret['product_recommended_picture'] = $this->recommendedPicture();
     $ret['product_image_full_url'] = $this->getPictureUrl();
     $ret['product_thumb_full_url'] = $this->getThumbUrl();
     $ret['product_image_full_path'] = $this->getPicturePath();
     $ret['product_thumb_full_path'] = $this->getThumbPath();
     $ret['product_shorten_summary'] = myshop_utils::truncate_tagsafe($this->getVar('product_summary'), MYSHOP_SUMMARY_MAXLENGTH);
     $ret['product_shorten_description'] = myshop_utils::truncate_tagsafe($this->getVar('product_description'), MYSHOP_SUMMARY_MAXLENGTH);
     return $ret;
 }