Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Скажите, а под какую версию SImpla проверялись данные модули?Несколько инструкций
else { // генерируемые связанные товары
$products->categories = $this->categories->get_categories(array('product_id'=>$product->id));
$category = reset($products->categories);
$related_products = array();
$after = false;
$products = $this->products->get_products(array('category_id' => $category->id, 'limit' => 100, 'in_stock'=>1, 'visible'=>1));
foreach($products as $p)
{
if($after && count($related_products) < 6)
$related_products[$p->id] = $p;
elseif($p->id == $product->id)
$after = true;
}
if(count($related_products) < 6)
foreach($products as $p)
if($p->id != $product->id && count($related_products) < 6)
$related_products[$p->id] = $p;
else break;
$related_products_images = $this->products->get_images(array('product_id'=>array_keys($related_products)));
foreach($related_products_images as $related_product_image)
if(isset($related_products[$related_product_image->product_id]))
$related_products[$related_product_image->product_id]->images[] = $related_product_image;
$related_products_variants = $this->variants->get_variants(array('product_id'=>array_keys($related_products), 'instock'=>true));
foreach($related_products_variants as $related_product_variant)
{
if(isset($related_products[$related_product_variant->product_id]))
{
$related_product_variant->price *= (100-$discount)/100;
$related_products[$related_product_variant->product_id]->variants[] = $related_product_variant;
}
}
foreach($related_products as $r)
{
$r->image = &$r->images[0];
$r->variant = &$r->variants[0];
}
$this->design->assign('related_products', $related_products);
} // end: генерируемые связанные товары
в какой строке , я проверил у меня работаетЗдравствуйте, помогите, пожалуйста, решить проблему с синтаксисом языка. Выводится сообщение: syntax error, unexpected T_STRING
Строка выделенная жирным.
Код:else { // генерируемые связанные товары $products->categories = $this->categories->get_categories(array('product_id'=>$product->id)); $category = reset($products->categories); $related_products = array(); $after = false; $products = $this->products->get_products(array('category_id' => $category->id, 'limit' => 100, 'in_stock'=>1, 'visible'=>1)); foreach($products as $p) { if($after && count($related_products) < 6) $related_products[$p->id] = $p; elseif($p->id == $product->id) $after = true; } if(count($related_products) < 6) foreach($products as $p) if($p->id != $product->id && count($related_products) < 6) $related_products[$p->id] = $p; else break; $related_products_images = $this->products->get_images(array('product_id'=>array_keys($related_products))); foreach($related_products_images as $related_product_image) if(isset($related_products[$related_product_image->product_id])) $related_products[$related_product_image->product_id]->images[] = $related_product_image; $related_products_variants = $this->variants->get_variants(array('product_id'=>array_keys($related_products), 'instock'=>true)); foreach($related_products_variants as $related_product_variant) { if(isset($related_products[$related_product_variant->product_id])) { $related_product_variant->price *= (100-$discount)/100; $related_products[$related_product_variant->product_id]->variants[] = $related_product_variant; } } foreach($related_products as $r) { $r->image = &$r->images[0]; $r->variant = &$r->variants[0]; } $this->design->assign('related_products', $related_products); } // end: генерируемые связанные товары
Здравствуйте, помогите, пожалуйста, решить проблему с синтаксисом языка. Выводится сообщение: syntax error, unexpected T_STRING
Строка выделенная жирным.
Код:else { // генерируемые связанные товары $products->categories = $this->categories->get_categories(array('product_id'=>$product->id)); $category = reset($products->categories); $related_products = array(); $after = false; $products = $this->products->get_products(array('category_id' => $category->id, 'limit' => 100, 'in_stock'=>1, 'visible'=>1)); foreach($products as $p) { if($after && count($related_products) < 6) $related_products[$p->id] = $p; elseif($p->id == $product->id) $after = true; } if(count($related_products) < 6) foreach($products as $p) if($p->id != $product->id && count($related_products) < 6) $related_products[$p->id] = $p; else break; $related_products_images = $this->products->get_images(array('product_id'=>array_keys($related_products))); foreach($related_products_images as $related_product_image) if(isset($related_products[$related_product_image->product_id])) $related_products[$related_product_image->product_id]->images[] = $related_product_image; $related_products_variants = $this->variants->get_variants(array('product_id'=>array_keys($related_products), 'instock'=>true)); foreach($related_products_variants as $related_product_variant) { if(isset($related_products[$related_product_variant->product_id])) { $related_product_variant->price *= (100-$discount)/100; $related_products[$related_product_variant->product_id]->variants[] = $related_product_variant; } } foreach($related_products as $r) { $r->image = &$r->images[0]; $r->variant = &$r->variants[0]; } $this->design->assign('related_products', $related_products); } // end: генерируемые связанные товары