Jump to content
thirty bees forum

zimmer-media

Trusted Members
  • Posts

    486
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by zimmer-media

  1. @mockob I have now changed the code in my first post. There will be no error message, because the shopping cart is shown after selecting. The add to cart button is hidden. The first line of the changed code is: <option value="choose" selected="selected" title="--choose--">{l s='--Please Select--'}</option> -- --
  2. @mockob No, unfortunately not yet. I think it would be necessary to insert an additional code in which, for example, only after the selection of the shopping cart appears active. But it is a start.
  3. @mockob said in I'm going to create a free module: I don’t find it quite professional to be able to choose “please choose” from the drop down lis Please look here, I hope this helps you. https://forum.thirtybees.com/topic/1260/products-with-variants-without-pre-selection-of-a-variant
  4. Note, it only works with the dropdown box
  5. I read a few days ago in a topic that in the product view for articles with variants of the customer must choose because there is no pre-selection. Since I had this time in a PS-Shop, I have again found in the PS-Forum. Here I would like to emphasize that I have not completely tested the ordering process, but the product in the shopping cart works. So you see in products with variants, no preselection of a particular variant. find in your theme/product.tpl {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option> {/foreach} replace with <option value="choose" selected="selected" title="--choose--">{l s='--Please Select--'}</option> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}" {if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute)} selected="selected" {/if} title="{$group_attribute|escape:'html':'UTF-8'}"> {$group_attribute|escape:'html':'UTF-8'} </option> {/foreach} before _ after changing
  6. Of course, more than one text box can be added as needed to customize the data (change all "extra_field"). It is important in the product.tpl the title of the text field {ls = 'Extrafield'} </ h3> for the front view and in the informations.tpl the name of your textarea { ls = 'Extrafield'} correctly, so that you do not confuse this when entering. In the front view, the text areas are only displayed if data has been saved in the field.
  7. step 1 Add an entry to the database in the table prefixproductlang (for example name - what you need) step 2.1 modify the file “Product.php” from “/classes/Product.php”, preferably in the folder classes Override “/override/classes/Product.php” save see the lines /** @var string Long description */ public $description; /** @var string Short description */ public $description_short; just add the following /** @var string Extra Field */ public $extra_field; step 2.2 for example find 'name' => ['type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 128], 'description' => ['type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'], after this insert 'extra_field' => ['type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'], step 3 copy your informations.tpl under override / controllers / admin / templates / products / informations.tpl for example and find the code (depending on where this additional field should appear.) <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="description" type="tinymce" multilang="true"}</span></div> <label class="control-label col-lg-2" for="description_{$id_lang}"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='Appears in the body of the product page.'}"> {l s='Description'} </span> </label> <div class="col-lg-9"> {include file="controllers/products/textarea_lang.tpl" languages=$languages input_name='description' class="autoload_rte" input_value=$product->description} </div> </div> after this insert <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="extra_field" type="tinymce" multilang="true"}</span></div> <label class="control-label col-lg-2" for="extra_field_{$id_lang}"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='Appears in the body of the product page.'}"> {l s='Extrafield'} </span> </label> <div class="col-lg-9"> {include file="controllers/products/textarea_lang.tpl" languages=$languages input_name='extra_field' class="autoload_rte" input_value=$product->extra_field} </div> </div> step 4 if you want to see this field in your frontoffice product view - in your theme product.tpl add the follow code with in your tpl ( for example default theme) find {if isset($product) && $product->description} <section id="product-description" class="page-product-box"> <h3 class="page-product-heading">{l s='More info'}</h3> <div class="rte">{$product->description}</div> </section> {/if} insert after this {if isset($product) && $product->extra_field} <section id="extra_field" class="page-product-box"> <h3 class="page-product-heading">{l s='Extrafield'}</h3> <div class="rte">{$product->extra_field}</div> </section> {/if} backoffice product page frontoffice product page new
  8. step 1 Add an entry to the database in the table prefix_product (for example name and lenght - what you need) step 2.1 modify the file “Product.php” from “/classes/Product.php”, preferably in the folder classes Override “/override/classes/Product.php” save see the lines /** @var int Supplier id */ public $id_supplier; /** @var int default Category id */ public $id_category_default; /** @var int default Shop id */ public $id_shop_default; /** @var string Manufacturer name */ public $manufacturer_name; just add the following /** @var string new_field */ public $new_field; step 2.2 for example find 'id_supplier' => ['type' => self::TYPE_INT, 'validate' => 'isUnsignedId'], 'reference' => ['type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32], after this add 'new_field' => ['type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 200], step 3 copy your informations.tpl under override / controllers / admin / templates / products / informations.tpl for example and find the code (depending on where this additional field should appear.) <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}</span></div> <label class="control-label col-lg-2 required" for="name_{$id_lang}"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='The public name for this product.'} {l s='Invalid characters:'} &lt;&gt;;=#{}"> {l s='Name'} </span> </label> <div class="col-lg-5"> {include file="controllers/products/input_text_lang.tpl" languages=$languages input_class="{$class_input_ajax}{if !$product->id || Configuration::get('PS_FORCE_FRIENDLY_PRODUCT')}copy2friendlyUrl{/if} updateCurrentText" input_value=$product->name input_name="name" required=true } </div> </div> after this insert <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}</span></div> <label class="control-label col-lg-2"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='The additional field for your product'} {l s='Invalid characters:'} &lt;&gt;;=#{}"> {l s='New Field'} </span> </label> <div class="col-lg-5"> <input type="text" id="new_field" name="new_field" value="{$product->new_field|default:''}"/> </div> </div> step 4 if you want to see this field in your frontoffice product view - in your theme product.tpl add the follow code with h1-6 tag or p tag in your tpl {$product->new_field|escape:'html':'UTF-8'} product admin product front office before product front office after changes
  9. can an admin or moderator please move this topic to the new category Tips and Tricks
  10. can an admin or moderator please move this topic to the new category Tips and Tricks
  11. @hfxracing I use faqextra_ (Presta-Apps Solutions) _v2.0.3.zip modules (Presta-Apps Solutions). It has some useful features and can be slightly more than a normal faq module. Apparently the module is no longer offered by the programmer. Works with TB so far without problems. Maybe also a way to expand your shop.
  12. @hfxracing I know that there is also a free module in the PS forum. Only how current the module is still the Kompaitibilität with TB I do not know at the moment. if necessary look for my instructions for an additional field. Just customize the data to work as a text box. https://forum.thirtybees.com/topic/1215/add-extra-field-to-product-selection-in-admin-orders/14
  13. I expand my information In the product list of the BO for filtering, adjust the following parameters in the code: for example under "/override/controllers/admin/AdminProductsController.php" after the code $this->fields_list['name'] = [ 'title' => $this->l('Name'), 'filter_key' => 'b!name', ]; add: $this->fields_list['artist_name'] = [ 'title' => $this->l('Artist'), ]; with filter
  14. its not perfect, but helpful as example to add extra field for product name step 1 Add an entry to the database in the table prefix_product step 2.1 modify the file "Product.php" from "/classes/Product.php", preferably in the folder classes Override "/override/classes/Product.php" save see the lines /** @var int Supplier id */ public $id_supplier; /** @var int default Category id */ public $id_category_default; /** @var int default Shop id */ public $id_shop_default; /** @var string Manufacturer name */ public $manufacturer_name; just add the following /** @var string Artist name */ public $artist_name; step 2.2 for example find 'id_supplier' => ['type' => self::TYPE_INT, 'validate' => 'isUnsignedId'], 'reference' => ['type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32], after this add 'artist_name' => ['type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 200], step 3 copy your informations.tpl under override / controllers / admin / templates / products / informations.tpl and find the code <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}</span></div> <label class="control-label col-lg-2 required" for="name_{$id_lang}"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='The public name for this product.'} {l s='Invalid characters:'} &lt;&gt;;=#{}"> {l s='Name'} </span> </label> <div class="col-lg-5"> {include file="controllers/products/input_text_lang.tpl" languages=$languages input_class="{$class_input_ajax}{if !$product->id || Configuration::get('PS_FORCE_FRIENDLY_PRODUCT')}copy2friendlyUrl{/if} updateCurrentText" input_value=$product->name input_name="name" required=true } </div> </div> after this insert <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}</span></div> <label class="control-label col-lg-2"> <span class="label-tooltip" data-toggle="tooltip" title="{l s='The second public name for this product.'} {l s='Invalid characters:'} &lt;&gt;;=#{}"> {l s='Artist Name'} </span> </label> <div class="col-lg-5"> <input type="text" id="artist_name" name="artist_name" value="{$product->artist_name|default:''}"/> </div> </div> step 4 product view - in your theme product.tpl ``` {$product->name|escape:'html':'UTF-8'} change to {$product->name|escape:'html':'UTF-8'} - {$product->artist_name|escape:'html':'UTF-8'} ``` my result: For the invoice etc, you should include {$product-> artist_name | escape: 'html': 'UTF-8'}
  15. In the community-theme-default / manufacturer.tpl I missed the picture, for example, the manufacturer. and adapted the code: standard ``` {include file="$tpl_dir./errors.tpl"} {if empty($errors)} {$manufacturer->name|escape:'html':'UTF-8'} {if !empty($manufacturer->description)} {$manufacturer->description} {elseif !empty($manufacturer->short_description)} {$manufacturer->short_description} {/if} {if !empty($products)} {l s='List of products by manufacturer'} {$manufacturer->name|escape:'html':'UTF-8'} ``` customized ``` {include file="$tpl_dir./errors.tpl"} {if empty($errors)} {$manufacturer->name|escape:'html':'UTF-8'} {if !empty($manufacturer->description) || !empty($manufacturer->short_description)} {/if} {if !empty($manufacturer->short_description)} {$manufacturer->short_description} {/if} {if !empty($products)} {l s='List of products by manufacturer'} {$manufacturer->name|escape:'html':'UTF-8'} ```
  16. I adapt the files since PS always to my ideas, no preference which template. This refers to both the manufacturer page and the category page. Here I move, inter alia, the program code. Sometimes I adjust the information for the ALT and TITLE tags because they are missing in the files. For Google SEO, everyone is ALT and TITLE text is recognized additional positive text, if it is entered correctly. Even with various standard modules, I work on such trifles, so that have a positive effect and are not deposited in the code. Optical advantages / disadvantages compared to other systems: As an example, if I am myself as a customer in an online shop and then look at the manufacturer page or category page and have seen above the descriptions and then only the articles, I find it personally gruesome and lose the desire. And the descriptions can sometimes be quite long. Even if there is the possibility to expand the full text. Some shop systems show the article lists without pagination that I find personally just as terrible. You have to scroll and scroll to get into the footer area, for example, if you want to find and read the terms and conditions or other information.
  17. the 1.0.4 under the post, I noticed only after my entry, it was too small because I have only read the main text of you.
  18. sorry, i see now, you have tag 1.0.4 under your post
  19. @slick_303 hi slick. I can not confirm this problem. I do not use the TB theme in the admin area, because I've had too many bad views myself at the beginning since the migration and tb-version 1.0.3 is installed.
  20. @b_otho You can also follow the hints of Nemo and customize your code in your files / overrides. Continuing then only the invoice and the produkt.tpl would have to be adjusted. If necessary, additional files where the additional field should appear. The other note from the forum, which I have previously used even with PS, I can not find right now. https://mypresta.eu/en/art/developer/new-field-product-backoffice.html
  21. @b_otho Alternatively, I do not know if you need, for example, information in the manufacturer lists or supplier lists. If they are invisible / deactivated for the customer, then use them, for example. you can use artist as manufacturer or supplier. So you can separately customize the product list view and filter such as from this topic: https://forum.thirtybees.com/topic/1223/product-list-bo-with-manufacturers-and-suppliers-columns
  22. @ukclearance I do not know if I understood the topic correctly, but I hope the picture and the numbers will help.
  23. @b_otho I join the comment from @wakabayashi. My additional recommendation to deposit the artist in the article features and then set up as a filter for the end user. You may also set up and enter additional features such as the type of disc CD / DVD / LP, etc.
  24. Here you can see the changed code. If it is not completely needed, you can eg omit the lines and the array for the manufacturer or the supplier. original part 1 ``` $idShop = Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXTSHOP ? (int) $this->context->shop->id : 'a.idshopdefault'; $this->join .= ' JOIN '._DB_PREFIX_.'product_shop sa ON (a.id_product = sa.id_product AND sa.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'category_lang cl ON ('.$alias.'.id_category_default = cl.id_category AND b.id_lang = cl.id_lang AND cl.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'shop shop ON (shop.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'image_shop imageshop ON (imageshop.id_product = a.id_product AND imageshop.cover = 1 AND imageshop.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_image = image_shop.id_image) LEFT JOIN '._DB_PREFIX_.'product_download pd ON (pd.id_product = a.id_product AND pd.active = 1)'; new $idShop = Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXTSHOP ? (int) $this->context->shop->id : 'a.idshopdefault'; $this->join .= ' JOIN '._DB_PREFIX_.'product_shop sa ON (a.id_product = sa.id_product AND sa.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'category_lang cl ON ('.$alias.'.id_category_default = cl.id_category AND b.id_lang = cl.id_lang AND cl.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'shop shop ON (shop.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'image_shop imageshop ON (imageshop.id_product = a.id_product AND imageshop.cover = 1 AND imageshop.idshop = '.$idShop.') LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_image = imageshop.id_image) LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = a.id_manufacturer) LEFT JOIN '._DB_PREFIX_.'supplier supp ON (supp.idsupplier = a.id_supplier) LEFT JOIN '._DB_PREFIX_.'product_download pd ON (pd.id_product = a.id_product AND pd.active = 1)'; ``` original part 2 $this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, '; $this->_select .= $aliasImage.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`'; new $this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, '; $this->_select .= 'm.`name` AS `manufacturer_namen`, '; $this->_select .= 'shop.name as shopname, supp.`name` AS `supp`, '; $this->_select .= $aliasImage.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`'; original part 3 ``` $this->fieldslist['active'] = [ 'title' => $this->l('Status'), 'active' => 'status', 'filterkey' => $alias.'!active', 'align' => 'text-center', 'type' => 'bool', 'class' => 'fixed-width-sm', 'orderby' => false, ]; if ($joinCategory && (int) $this->id_current_category) { $this->fields_list['position'] = [ 'title' => $this->l('Position'), 'filter_key' => 'cp!position', 'align' => 'center', 'position' => 'position', ]; ``` new ``` $this->fieldslist['active'] = [ 'title' => $this->l('Status'), 'active' => 'status', 'filterkey' => $alias.'!active', 'align' => 'text-center', 'type' => 'bool', 'class' => 'fixed-width-sm', 'orderby' => false, ]; $this->fields_list['manufacturer_namen'] = [ 'title' => $this->l('Manufacturer'), 'filter_key' => 'm!name', 'orderby' => true, ]; $this->fields_list['supp'] = [ 'title' => $this->l('Supplier'), 'filter_key' => 'supp!name' ]; if ($joinCategory && (int) $this->id_current_category) { $this->fields_list['position'] = [ 'title' => $this->l('Position'), 'filter_key' => 'cp!position', 'align' => 'center', 'position' => 'position', ]; ```
×
×
  • Create New...