Polskie wsparcie PrestaShop
PrestaShop => PrestaShop 1.7 => Wątek zaczęty przez: krzysiek1985 w Maj 22, 2018, 10:59:14 pm
-
Witam mam pytanie i bardzo proszę o pomoc jeżeli jest tu ktoś kto się na tym zna będę bardzo wdzięczny.
Problem mój polega na tym że chciałbym aby na stronie konkretnego produktu była możliwość wyłączenia opcji dodaj do koszyka lub opcji kup teraz. Mam na myśli to że jeżeli włącze tryb katalogowy to znika mi wszędzie koszyk ok ale mam połowe produktów które chce tylko jako sam katalog bez możliwości ich zamówienia czyli aby nie było widać opcji kup teraz czy dodaj do koszyka a część produktów na których chcę aby ta opcja została aktywna.
Bardzo proszę o jakieś rozwiązanie
z góry dziękuję
-
w karcie produktu masz takie ustawienia. mozesz wylaczyc cene, przycisk... "sprzedaż (tryb katalogu jeśli nieaktywne)" - karta "informacje"
-
No tak rozumiem ale wtedy jest brak możliwości zamówienia ale pojawia się jedno ale dodaj do koszyka nadal się pojawia z tym że jako nie aktywne a ja chcę aby nie było tego przycisku widać z chwila kiedy nie aktywne czy jest w kodzie gdzieś to aby można było to ukryć
-
w product.css dodaj dla tego elementu display: none jak zobaczysz w product.tpl jest tam warunek wyświetlający przycisk aktywny / nieaktywny
-
Wszystko pięknie tylko nie wiem w którym miejscu to zrobić :/
-
w plikach product [catalog/_partials/product-add-to-cart.tpl] oraz możesz dodać instrukcję w custom.css
-
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2017 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="product-add-to-cart">
{if !$configuration.is_catalog}
<span class="control-label">{l s='Quantity' d='Shop.Theme.Catalog'}</span>
{block name='product_quantity'}
<div class="product-quantity">
<div class="qty">
<input
type="text"
name="qty"
id="quantity_wanted"
value="{$product.quantity_wanted}"
class="input-group"
min="{$product.minimal_quantity}"
>
</div>
<div class="add">
<button
class="btn btn-primary add-to-cart"
data-button-action="add-to-cart"
type="submit"
{if !$product.add_to_cart_url}
disabled
{/if}
>
<!-- <i class="material-icons shopping-cart"></i> -->
{l s='Add to cart' d='Shop.Theme.Actions'}
</button>
{block name='product_availability'}
<span id="product-availability">
{if $product.show_availability && $product.availability_message}
{if $product.availability == 'available'}
<i class="material-icons product-available"></i>
{elseif $product.availability == 'last_remaining_items'}
<i class="material-icons product-last-items"></i>
{else}
<i class="material-icons product-unavailable"></i>
{/if}
{$product.availability_message}
{/if}
</span>
{/block}
</div>
</div>
<div class="clearfix"></div>
{/block}
{block name='product_minimal_quantity'}
<p class="product-minimal-quantity">
{if $product.minimal_quantity > 1}
{l
s='The minimum purchase order quantity for the product is %quantity%.'
d='Shop.Theme.Checkout'
sprintf=['%quantity%' => $product.minimal_quantity]
}
{/if}
</p>
{/block}
{/if}
</div>
Taki kod jest rozumiem że odpowiada ta funkcja :
<button
class="btn btn-primary add-to-cart"
data-button-action="add-to-cart"
type="submit"
{if !$product.add_to_cart_url}
disabled
{/if}
>
<!-- <i class="material-icons shopping-cart"> -->
{l s='Add to cart' d='Shop.Theme.Actions'}
</button>
ale co mam dopisać do niej przepraszam ale nie jestem w tym tak biegły a potrzebuje to zmienić.
-
nie wiem w który miejscu mam dopisać display:none; który styl za to odpowiada sprawdzałem na rózne sposoby ale nie działa chyba że coś a zapewne coś źle robię proszę o pomoc
-
product add to cart
<div class="product-add-to-cart">
{if !$configuration.is_catalog}
<span class="control-label">{l s='Quantity' d='Shop.Theme.Catalog'}</span>
{block name='product_quantity'}
<div class="product-quantity">
<div class="qty">
<input
type="text"
name="qty"
id="quantity_wanted"
value="{$product.quantity_wanted}"
class="input-group"
min="{$product.minimal_quantity}"
>
</div>
<div class="add">
<button
class="btn btn-primary add-to-cart"
data-button-action="add-to-cart"
type="submit"
{if !$product.add_to_cart_url}
disabled
{/if}
>
<!-- <i class="material-icons shopping-cart"></i> -->
{l s='Add to cart' d='Shop.Theme.Actions'}
</button>
tutaj product.tpl
<div class="product-information">
{if $product.is_customizable && count($product.customizations.fields)}
{block name='product_customization'}
{include file="catalog/_partials/product-customization.tpl" customizations=$product.customizations}
{/block}
{/if}
<div class="product-actions">
{block name='product_buy'}
<form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh">
<input type="hidden" name="token" value="{$static_token}">
<input type="hidden" name="id_product" value="{$product.id}" id="product_page_product_id">
<input type="hidden" name="id_customization" value="{$product.id_customization}" id="product_customization_id">
{block name='product_variants'}
{include file='catalog/_partials/product-variants.tpl'}
{/block}
{block name='product_pack'}
{if $packItems}
<section class="product-pack">
<h3 class="h4">{l s='This pack contains' d='Shop.Theme.Catalog'}</h3>
{foreach from=$packItems item="product_pack"}
{block name='product_miniature'}
{include file='catalog/_partials/miniatures/pack-product.tpl' product=$product_pack}
{/block}
{/foreach}
</section>
{/if}
{/block}
{block name='product_discounts'}
{include file='catalog/_partials/product-discounts.tpl'}
{/block}
{block name='product_add_to_cart'}
{include file='catalog/_partials/product-add-to-cart.tpl'}
{/block}
{hook h='displayProductButtons' product=$product}
{block name='product_refresh'}
<input class="product-refresh ps-hidden-by-js" name="refresh" type="submit" value="{l s='Refresh' d='Shop.Theme.Actions'}">
{/block}
</form>
{/block}
</div>
{hook h='displayReassurance'}
</div>
</div>
</div>
</div>
a tutaj css
.product-actions .add-to-cart {
background: #333e48;
border-color: #333e48;
color: #ffffff;
font-size: 14px;
font-weight: 600;
height: 50px;
line-height: 50px;
padding: 0 30px 0 30px;
text-transform: none;
font-family: 'Roboto', sans-serif;
text-transform: uppercase;
}
.product-actions .add-to-cart:hover{
background-color:#b11e22;
border-color:#b11e22;
}
Mozę mi ktoś pomóc jak to zrobić aby nie było tego przycisku widać który jest nieaktywny a się wyświetla?
-
Nikt nie jest w stanie mi pomóc?
-
dobra poradziłem sobie dodałem zamiast disable na hidden