Jump to content

Recommended Posts

Hallo zusammen,

 

ich würde gerne den Preis und den Warenkorb-Button für eine Kategorie entfernen.

Die restlichen kategorien sollten weiterhin die Shop-Funktion behalten das man Artikel kaufen kann.

 

Ich habe bereit folgendes probiert folgenden Code in mein product.tpl einzufügen, das ich im Forum gefunden hatte für meine Prestashop 1.4.9 Version, aber da passiert leider nichts:

{if $product->id_category_default != 3}

 

 

Hier ist der komplette Auszug damit ihr einen Überblick habt an welcher Stelle ich den Code eingefügt habe. Meine Änderungen habe ich mit einem eingeschlossen (ist nur ganz oben und unten eingefügt worden).:

[b]<!-- Code start to remove Price for Product ID 3 -->
{if $product->id_category_default != 3}[/b]

 {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
 <!-- add to cart form-->
 <form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart.php')}" method="post">
  <!-- hidden datas -->
  <p class="hidden">
<input type="hidden" name="token" value="{$static_token}" />
<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
  </p>
  <!-- prices -->
  {if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}

....

  <!-- Out of stock hook -->
  <p id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
{$HOOK_PRODUCT_OOS}
  </p>
  <p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if} >{l s='Warning: Last items in stock!'}</p>
  {if $product->online_only}
<p>{l s='Online only'}</p>
  {/if}
  <p{if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} style="display: none;"{/if} id="add_to_cart" class="buttons_bottom_block"><input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" /></p>
  {if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}
  <div class="clear"></div>
 </form>
 {/if}


[b]{/if}
<!-- Code end to remove Price for Product ID 3 -->[/b]

 

 

Es wäre schön wenn mir jemand einen Hinweis geben könnte waren das liegt das es nicht funktioniert.

 

Im Foto habe ich nochmal die Stelle markiert die entfernt werden soll für meine Artikel mit der Kategorie 3.

 

Danke euch

post-442159-0-85099100-1363831380_thumb.jpg

Edited by kansas3d (see edit history)
Link to comment
Share on other sites

Cool Dankeschön rumata!

 

Gibt es evtl noch eine elegantere Lösung Beispielsweise mit Einfügen von Code damit man nicht bei jedem Artikel das von Hand auswählen muss und es das automatisch für alle Artikel einer Kategorie macht?

 

Danke auf jeden Fall ich weiss es echt zu schätzen :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...