увиличение колличество товарах в рекомендуемых товарах Есть решение

как увеличить количество товаров с 5 до 8 на странице товара рекомендуем посмотреть


2 ответа

  • 3

    в шаблоне product.html найдите что-то вроде
    <!-- RELATED PRODUCTS -->
    {$upselling = $product->upSelling()}
    {$crossselling = $product->crossSelling()}

    и исправьте на {$crossselling = $product->crossSelling(N)}, где N - нужное вам число рекомендуемых продуктов

  • 1
    КИР 6 ноября 2016 15:25 #

    Такая же тема. Все сделал как у вас. Не работает.

    Может в коде еще что то исправить??

    <h4>product.html</h4>


    <script type="text/javascript" src="{$wa_url}wa-content/js/jquery-plugins/jquery.cookie.js"></script>
    <script type="text/javascript" src="{$wa_theme_url}colorbox/jquery.colorbox-min.js"></script>
    <script type="text/javascript" src="{$wa_theme_url}colorbox/jquery.colorbox-ru.js"></script>
    <script type="text/javascript" src="{$wa_theme_url}product.js?v{$wa_theme_version}"></script>
    <link href="{$wa_theme_url}colorbox/colorbox.css" rel="stylesheet" type="text/css">

    <h1>{$product.name|escape}</h1>

    <div class="clear sorting inset">
    <ul>
    <li class="selected"><a href="{$wa->shop->productUrl($product)}">[`Overview`]</a></li>
    <li>
    <a href="{$wa->shop->productUrl($product, 'reviews')}">[`Reviews`]</a>
    <span class="hint">{$reviews_total_count}</span>
    </li>
    {foreach $product.pages as $page}
    <li><a href="{$wa->shop->productUrl($product, 'page', ['page_url' => $page.url])}">{$page.name|escape}</a></li>
    {/foreach}

    <!-- plugin hook: 'frontend_product.menu' -->
    {* @event frontend_product.%plugin_id%.menu *}
    {foreach $frontend_product as $_}{$_.menu}{/foreach}
    </ul>
    </div>

    <div class="clear">
    <div class="fl_left wp40 highslide-gallery">
    <table class="wp100">
    <tr>
    <td class="product_image">
    <div class="image" id="product-core-image">
    <div class="corner top left">
    {$wa->shop->badgeHtml($product.badge)}
    </div>
    {if $product.images}
    <a href="{$wa->shop->productImgUrl($product, '970')}" >
    {$wa->shop->productImgHtml($product, '284', ['id' => 'product-image', 'alt' => $product.name|escape|cat:' ':strip_tags($product.summary)|escape, 'default' => "`$wa_theme_url`img/dummy200.png"])}
    </a>
    {else}
    {$wa->shop->productImgHtml($product, '284', ['alt' => '', 'default' => "`$wa_theme_url`img/dummy200.png"])}
    {/if}
    </div>
    </td>
    </tr>
    </table>

    <!-- gallery -->
    {if count($product.images) > 1}
    <div id="product-gallery" class="gallery clear">
    {foreach $product.images as $image}
    <div class="image{if $image.id == $product.image_id} selected{/if}" >
    <a id="product-image-{$image.id}" href="{$wa->shop->productImgUrl(['id'=> $product.id, 'image_id' => $image.id, 'ext' => $image.ext, 'image_desc' => $image.description], '0x970')}" >{$wa->shop->productImgHtml(['id'=> $product.id, 'image_id' => $image.id, 'ext' => $image.ext, 'image_desc' => $image.description], '40x40', ['alt' => $product.name|cat:' - ':$image.description|escape])}</a>
    </div>
    {/foreach}
    </div>
    {/if}
    </div>


    <div class="fl_left wp60">
    <div class="right_product_data" id="product-content">

    <div class="clear">
    <div class="fl_left wp50">
    <div class="add2cart">
    <span data-price="{shop_currency($product.price, null, null, 0)}" class="price price_big">{shop_currency($product.price)}</span><br />
    {if $product.compare_price > 0}<strike class="compare-at-price small red"> {shop_currency($product.compare_price)} </strike>{/if}
    </div>

    {if $product.sku_type}
    {$product_available = $product.status}
    {else}
    {$product_available = false}
    {if count($product.skus) > 1}
    {foreach $product.skus as $sku}
    {$sku_available = $product.status && $sku.available && ($wa->shop->settings('ignore_stock_count') || $sku.count === null || $sku.count > 0)}
    {$product_available = $product_available or $sku_available}
    {/foreach}
    {else}
    {$sku = $product.skus[$product.sku_id]}
    {if !$sku.available}
    <p><em class="bold error">[`This product is not available for purchase`]</em></p>
    {elseif !$wa->shop->settings('ignore_stock_count') && !($sku.count === null || $sku.count > 0)}
    <div class="stocks"><strong class="stock-none"><i class="icon16 stock-transparent"></i>[`Out of stock`]</strong></div>
    {/if}
    {$product_available = $product.status && $sku.available && ($wa->shop->settings('ignore_stock_count') || $sku.count === null || $sku.count > 0)}
    {/if}
    {/if}

    <!-- stock info -->
    {if $product_available || count($product.skus) > 1}
    <div class="stocks">
    {function name=in_stock n=0 low=5 critical=2}
    {if $n > $low or $n === null}
    <strong class="stock-high"><i class="icon16 stock-green"></i>[`In stock`]</strong>
    {elseif $n > $critical}
    <strong class="stock-low"><i class="icon16 stock-yellow"></i>{_w("Only %d left in stock", "Only %d left in stock", $n)}</strong>
    {elseif $n > 0}
    <strong class="stock-critical"><i class="icon16 stock-red"></i>{_w("Only %d left in stock", "Only %d left in stock", $n)}</strong>
    {else}
    <strong class="stock-none"><i class="icon16 stock-transparent"></i>[`Out of stock`]</strong>
    {/if}
    {/function}
    {foreach $product.skus as $sku}
    <div {if $sku.id != $product.sku_id}style="display:none"{/if} id="sku-{$sku.id}-stock">
    {if $sku.stock}
    {foreach $stocks as $stock_id => $stock}
    {if isset($sku.stock[$stock_id])}
    {$stock_count = $sku.stock[$stock_id]}
    {else}
    {$stock_count = null}
    {/if}
    {$stock.name}: {in_stock n=$stock_count low=$stock.low_count critical=$stock.critical_count}<br>
    {/foreach}
    {else}
    {in_stock n=$sku.count}
    {/if}
    </div>
    {/foreach}
    {if $product.sku_type}
    <div id="sku-no-stock">
    <strong class="stock-none">[`Product with the selected option combination is not available for purchase`]</strong>
    </div>
    {/if}
    </div>
    {/if}

    </div>
    <div class="fl_left wp50">
    <div class="rating_block">
    <span class="rating" title="{sprintf('[`Average user rating: %s / 5`]', $product.rating)}">
    {if !empty($product.rating) && $product.rating > 0}
    {$wa->shop->ratingHtml($product.rating, 16)}
    {else}
    <i class="icon16 star-empty"></i><i class="icon16 star-empty"></i><i class="icon16 star-empty"></i><i class="icon16 star-empty"></i><i class="icon16 star-empty"></i>
    {/if}
    <span class="small">({$reviews_total_count})</span>
    </span>
    </div>

    <!-- compare -->
    <div class="small">
    <a {if $compare}style="display:none"{/if} class="compare-add inline-link" data-product="{$product.id}" href="#">[`Add to comparison table`]</a>
    <a {if !$compare}style="display:none"{/if} class="compare-remove inline-link" data-product="{$product.id}" href="#">[`Remove from comparison table`]</a>
    <a id="compare-link" {if count($compare) lt 2}style="display:none"{/if} href="{$wa->getUrl('/frontend/compare/', ['id' => implode(',', $compare) ])}" class="bold">[`Compare`] <span class="count">{count($compare)}</span></a>
    </div>

    <!-- plugin hook: 'frontend_product.cart' -->
    {* @event frontend_product.%plugin_id%.cart *}
    {foreach $frontend_product as $_}{$_.cart}{/foreach}
    </div>
    </div>



    <!-- add to cart -->
    <form id="cart-form" method="post" action="{$wa->getUrl('/frontendCart/add')}">
    <div class="cart_page_block bg_gray">

    {if $product.sku_type}
    <!-- SELECTABLE FEATURES selling mode -->
    {$product_available = $product.status}
    <div class="options">
    {foreach $features_selectable as $f}
    {$f.name}:
    <select data-feature-id="{$f.id}" class="sku-feature" name="features[{$f.id}]">
    {foreach $f.values as $v_id => $v}
    <option value="{$v_id}" {if $v@first}selected{/if}>{$v}</option>
    {/foreach}
    </select>
    <br>
    {/foreach}
    </div>
    {else}

    <!-- FLAT SKU LIST selling mode -->
    {$product_available = false}
    {if count($product.skus) > 1}
    {if 1}
    Выберите: <select name="sku_id" style="max-width: 100%">
    {foreach $product.skus as $sku}
    {$sku_available = $product.status && $sku.available && ($wa->shop->settings('ignore_stock_count') || $sku.count === null || $sku.count > 0)}
    {if 1 || $sku_available}
    <option value="{$sku.id}" {if $sku.id == $product.sku_id} selected="selected"{/if} data-compare-price="{shop_currency($sku.compare_price, $product.currency, null, 0)}" {if !$sku_available}data-disabled="1"{/if} data-price="{shop_currency($sku.price, $product.currency, null, 0)}"{if $sku.image_id} data-image-id="{$sku.image_id}"{/if}>{$sku.name|escape}</option>
    {/if}
    {$product_available = $product_available or $sku_available}
    {/foreach}
    </select>
    {else}
    <ul class="skus" id="product-skus">
    {foreach $product.skus as $sku}
    {$sku_available = $product.status && $sku.available && ($wa->shop->settings('ignore_stock_count') || $sku.count === null || $sku.count > 0)}
    <li>
    <label{if !$sku.available} class="disabled"{/if}>
    <input name="sku_id" type="radio" value="{$sku.id}"{if !$sku.available} disabled="true"{/if}{if !$sku_available}data-disabled="1"{/if}{if $sku.id == $product.sku_id} checked="checked"{/if} data-compare-price="{shop_currency($sku.compare_price, $product.currency, null, 0)}" data-price="{shop_currency($sku.price, $product.currency, null, 0)}"{if $sku.image_id} data-image-id="{$sku.image_id}"{/if}> <span>{$sku.name|escape}</span>
    {if $sku.sku}<span class="gray small">{$sku.sku|escape}</span>{/if}

    </label>
    </li>
    {$product_available = $product_available or $sku_available}
    {/foreach}
    </ul>
    {/if}
    {else}
    {if $sku.sku}
    <ul class="skus">
    <li>
    <span class="hint">{$sku.sku|escape}</span>
    </li>
    </ul>{/if}
    {$product_available = $product.status && $sku.available && ($wa->shop->settings('ignore_stock_count') || $sku.count === null || $sku.count > 0)}
    {/if}

    {/if}

    {if $services}
    <div class="purchase">
    <!-- services -->
    <div class="services">
    {foreach $services as $s}
    <div id="service-{$s.id}">
    <label>
    <input data-price="{shop_currency($s.price, $s.currency, null, 0)}" {if !$product_available}disabled="disabled"{/if} type="checkbox" name="services[]" value="{$s.id}"> {$s.name|escape} {if $s.price && !isset($s.variants)}(+<span class="service-price">{shop_currency($s.price, $s.currency)}</span>){/if}
    </label>
    {if isset($s.variants)}
    <select data-variant-id="{$s.variant_id}" class="service-variants w200" name="service_variant[{$s.id}]" disabled>
    {foreach $s.variants as $v}
    <option {if $s.variant_id == $v.id}selected{/if} data-price="{shop_currency($v.price, $s.currency, null, 0)}" id="service-variant-{$v.id}" value="{$v.id}">{$v.name|escape} (+{shop_currency($v.price, $s.currency)})</option>
    {/foreach}
    </select>
    {else}
    <input type="hidden" name="service_variant[{$s.id}]" value="{$s.variant_id}">
    {/if}
    </div>
    {/foreach}
    </div>
    </div>
    {/if}

    <!-- price -->
    <div class="add2cart">
    {shopPreorderPlugin::form($product)}
    <input type="hidden" name="product_id" value="{$product.id}">
    <span class="qty">
    <button onclick="changeAmount(); return false;">-</button>
    <input type="text" name="quantity" value="1" id="prod_quantity" class="w30">
    <button onclick="changeAmount(true); return false;">+</button>
    </span>
    <input type="submit" {if !$product_available}disabled="disabled"{/if} value="[`Add to cart`]" class="beauty_submit">
    <div class="added2cart dn small vmargin">{sprintf('[`%s is now <a href="%s"><strong>in your shopping cart</strong></a>`]', $product.name|escape, $wa->getUrl('shop/frontend/cart'))}</div>

    </div>
    </div>
    </form>




    <div class="clear">
    <!-- categories -->
    {if $product.categories}
    <p id="product-categories">
    [`Categories`]:
    {foreach $product.categories as $c}
    {if $c.status}
    <a href="{$wa->getUrl('/frontend/category', ['category_url' => $c.full_url])}" class="dark">{$c.name|escape}</a> 
    {/if}
    {/foreach}
    </p>
    {/if}

    <!-- tags -->
    {*{if $product.tags}
    <p class="tags" id="product-tags">
    [`Tags`]:
    {foreach $product.tags as $t}
    <a href="{$wa->getUrl('/frontend/tag', ['tag' => urlencode($t)])}">{$t}</a>
    {/foreach}
    </p>
    {/if}*}



    <!-- plugin hook: 'frontend_product.block_aux' -->
    {* @event frontend_product.%plugin_id%.block_aux *}
    {foreach $frontend_product as $_}{$_.block_aux}{/foreach}
    <br /><br />
    </div>


    </div>
    </div>
    </div>

    <!-- plugin hook: 'frontend_product.block' -->
    {* @event frontend_product.%plugin_id%.block *}
    {foreach $frontend_product as $_}{$_.block}{/foreach}

    {if $product.description}
    <div class="description" id="product-description">{$product.description}</div>
    {/if}

    <!-- product features -->
    {if $product.features}
    <div class="description">
    <h4>[`Features`]</h4>
    <table class="features" id="product-features">
    {foreach $product.features as $f_code => $f_value}
    <tr>
    <td class="name">
    {$features[$f_code].name|escape}
    </td>
    <td class="value">
    {if is_array($f_value)}
    {implode(', ', $f_value)}
    {else}
    {$f_value}
    {/if}
    </td>
    </tr>
    {/foreach}
    </table><br />
    </div>
    {/if}

    <!-- product reviews -->
    <br />
    <div class="reviews">
    <h3>{sprintf('[`%s reviews`]', $product.name|escape)}</h3>
    {if $reviews}
    <ul class="comments">
    {foreach $reviews as $review}
    <li data-id={$review.id} data-parent-id="0">
    {include file="review.html" reply_allowed=false inline}
    </li>
    {/foreach}
    </ul>
    {/if}
    {if !$reviews}
    <p>{sprintf('[`Be the first to <a href="%s">write a review</a> of this product!`]', 'reviews/')}</p>
    {else}
    {sprintf(_w(
    'Read <a href="%s">all %d review</a> on %s',
    'Read <a href="%s">all %d reviews</a> on %s',
    $reviews_total_count, false
    ), 'reviews/', $reviews_total_count, $product.name|escape)
    };
    {/if}
    <br />
    </div>


    <!-- RELATED PRODUCTS -->
    {$upselling = $product->upSelling()}
    {$crossselling = $product->crossSelling()}

    {if $upselling || $crossselling}


    {if $upselling}
    <br />
    <div class="related">
    <h3>
    [`See also`]
    {$compare_ids = array_merge(array($product.id), array_keys($upselling))}
    <input type="button" onClick="javascript:window.location='{$wa->getUrl('/frontend/compare', ['id' => implode(',', $compare_ids)])}';" value="[`Compare all`]" class="small" />
    </h3>
    {include file="list-thumbs.html" products=$upselling}
    </div>
    {/if}

    {if $crossselling}
    <br />
    <div class="related">
    <h3>{sprintf('[`Customers who bought %s also bought`]', $product.name|escape)}</h3>
    {include file="list-thumbs.html" products=$crossselling}
    </div>
    {/if}


    {/if}


    {$video = $product->video}
    {if $video}


    <div itemprop="embedHTML">
    <iframe src="{$video.url}" width="{$video.width}" height="{$video.height}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
    </div>
    <meta itemprop="width" content="{$video.width}">
    <meta itemprop="height" content="{$video.height}">
    </div>
    {/if}





    <script type="text/javascript">
    var currency = {json_encode($currency_info)};
    {if count($product.skus) > 1 or $product.sku_type}
    var sku_services = {json_encode($sku_services)};
    {/if}
    {if $product.sku_type}
    var sku_features = {json_encode($sku_features_selectable)};
    {/if}
    </script>
    {shopRees46Plugin::frontendProductBottom()}

Добавить ответ

Чтобы добавить комментарий, зарегистрируйтесь или войдите