Jump to content
thirty bees forum

zimmer-media

Trusted Members
  • Posts

    486
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by zimmer-media

  1. @lukewood In a shop where I need this feature, I have reduced the shipping weight in the areas. Instead of eg 2 kg only 1.8 kg. Instead of eg 5 kg only 4.5 kg etc. But that is not a perfect solution either.
  2. @lauraj Did you also add the categories in the module "Top horizontal menu"?
  3. @alwayspaws Have you ever tried the import with your own separator without changing this file? I do not know if it works. Since TB it is possible to import csv as well as .xls, .xlsx, .xlst, .ods, .ots. Since I myself do not need any changes, I did not concern myself with it. For the import with special separator I think (guess) that a change of this one file is not enough. I guess that is responsible for another file. In my view, it is a small but important form for import. I assume that at least one more file for import is at the core.
  4. @alwayspaws standard file tb 1.0.3 01515024061407form.tpl
  5. @alwayspaws I do not use a custom code for this. It is the original TB file.
  6. @alwayspaws Sorry Stephanie. I did not change the code at my core. My CSV files are set since Prestashop so that the field separator is a semicolon and a comma for multiple values. Therefore, I only exchange the two fields when importing. The default is a comma as a field separator and a semicolon as a multiple value. No matter if I work with Excel or eg OpenOffice. I only exchange the two details before importing (as in the picture). Anything else would just be extra work for me.
  7. for example default theme add the code <section class="page-product-box"> <h3 class="page-product-heading">Tags</h3> <div> {if Tag::getProductTags(Tools::getValue('id_product'))!=""} <ul class="producttags"> {foreach from=Tag::getProductTags(Tools::getValue('id_product')) key=k item=v} {foreach from=$v item=value} <li><a href="{$link->getPageLink('search', true, NULL, "tag={$value|urlencode}")}">{$value|escape:html:'UTF-8'}</a></li> {/foreach} {/foreach} </ul> {else} {l s='No tags specified yet' mod='blocktags'} {/if} </div> </section> after this code ``` {if !empty($accessories)} <section id="product-accessories" class="page-product-box"> <h3 class="page-product-heading">{l s='Accessories'}</h3> <div class="accessories-block"> {include file="$tpl_dir./product-list.tpl" products=$accessories} </div> </section> {/if} ``` (custom)css code if necessary adjust the css code to the template (color, style, etc) ``` .producttags { list-style:none; position:relative; clear:both; display:block; padding-bottom:20px; margin-bottom:20px; } .producttags li, .producttags a{ float:left; height:24px; line-height:24px; position:relative; font-size:11px; } .producttags a{ margin-left:20px; padding:0 10px 0 12px; background:#0089e0; color:#fff; text-decoration:none; -moz-border-radius-bottomright:4px; -webkit-border-bottom-right-radius:4px; border-bottom-right-radius:4px; -moz-border-radius-topright:4px; -webkit-border-top-right-radius:4px; border-top-right-radius:4px; } .producttags a:visited{ color:#fff; } .producttags a:before{ content:""; float:left; position:absolute; top:0; left:-12px; width:0; height:0; border-color:transparent #0089e0 transparent transparent; border-style:solid; border-width:12px 12px 12px 0; } .producttags a:after{ content:""; position:absolute; top:10px; left:0; float:left; width:4px; height:4px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; background:#fff; -moz-box-shadow:-1px -1px 2px #004977; -webkit-box-shadow:-1px -1px 2px #004977; box-shadow:-1px -1px 2px #004977; } .producttags a:hover{background:#555; text-decoration:none;} .producttags a:hover:before{border-color:transparent #555 transparent transparent;} ``` and - and -
  8. @30knees You can move or copy the discount table under the price display. In the default theme following code: {if !empty($quantity_discounts)} <section id="product-volume-discounts" class="page-product-box"> <h3 class="page-product-heading">{l s='Volume discounts'}</h3> <div id="quantityDiscount" class="table-responsive"> <table class="table-product-discounts table table-condensed table-bordered table-hover"> <thead> <tr> <th>{l s='Quantity'}</th> <th>{if $display_discount_price}{l s='Price'}{else}{l s='Discount'}{/if}</th> <th>{l s='You Save'}</th> </tr> </thead> <tbody> {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'} {$realDiscountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval} {else} {$realDiscountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval} {/if} <tr id="quantityDiscount_{$quantity_discount.id_product_attribute}" class="quantityDiscount_{$quantity_discount.id_product_attribute}" data-real-discount-value="{convertPrice price = $realDiscountPrice}" data-discount-type="{$quantity_discount.reduction_type}" data-discount="{$quantity_discount.real_value|floatval}" data-discount-quantity="{$quantity_discount.quantity|intval}"> <td> {$quantity_discount.quantity|intval} </td> <td> {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'} {if $display_discount_price} {if $quantity_discount.reduction_tax == 0 && !$quantity_discount.price} {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval} {else} {convertPrice price=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval} {/if} {else} {convertPrice price=$quantity_discount.real_value|floatval} {/if} {else} {if $display_discount_price} {if $quantity_discount.reduction_tax == 0} {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval} {else} {convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval} {/if} {else} {$quantity_discount.real_value|floatval}% {/if} {/if} </td> <td> <span>{l s='Up to'}</span> {if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'} {$discountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval} {else} {$discountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval} {/if} {$discountPrice=$discountPrice * $quantity_discount.quantity} {$qtyProductPrice=$productPriceWithoutReduction|floatval * $quantity_discount.quantity} {convertPrice price=$qtyProductPrice - $discountPrice} </td> </tr> {/foreach} </tbody> </table> </div> </section> {/if} before <div class="product_attributes clearfix">
  9. I wish everyone a happy, healthy and successful new year from Germany. Welcome 2018 ........
  10. @spidawebs I do not know if the change Grid and List view is still under discussion. If you use the default theme, you can actually make the changes in the theme module. If you want to see the change afterwards, you must clear the cache, and it is essential to delete the cookies.
  11. @30knees what do you think of this view?
  12. thanks - move is faster as rewrite new ;)
  13. @slick_303 Thanks, I will try the previous version again.
  14. @b_otho have you tried to change the status
  15. zimmer-media

    cron jobs

    In the current module version, I can not save new entries or modify existing entries. An error message does not appear.
  16. I do not know that. I suspect yes. This has not happened in the years of use with us.
  17. Through my various dropshipping wholesalers, I've been using a separate php script for a few years now. I found it at that time after a long search in the PS forum. With this script all quantities are emptied during the update and then re-imported. If, for example, items are not listed in the CSV file, they will automatically receive the amount zero (may be irritating if the sub item number variant is not correct). It works for products with or without variants, if the article number (sub-article number of the variant is correct). Upload the additional script (php) once into the main directory (eg httpdocs). Upload the current CSV file (semicolon separated) to the main directory before each update. To update the quantity in the browser, enter the link and wait until it has run through. There is no extra notice after the update, only a white page and the favicon appears in the browser line. The link to the update: http://yourwebsite.com/update.php I myself have not tried to make any changes with the script, since it is sufficient for me so far. Personal note: for the top line of the CSV file - column 1 = "reference", column 2 = "quantity". With the renaming of the php file and the CSV file I had no problems so far. It is important only when renaming the CSV file to change this in the php file ($remotecsvfile = 'update.csv'; //MY PATH; CHANGE TO YOUR NEED, SAME FOR THE FILE NAME). update.php ``` <?php // PRESTASHOP SETTINGS FILE require_once ('config/settings.inc.php'); // REMOTE CSV FILE (CUSTOMIZE YOURCSVFILEPATH, CAN BE AN URL OR A LOCAL PATH) $remotecsvfile = 'update.csv'; //MY PATH; CHANGE TO YOUR NEED, SAME FOR THE FILE NAME // DB CONNECTION (CUSTOMIZE YOURDBHOSTNAME AND YOURDBPORT) $db = new PDO("mysql:host=localhost;port=3306;dbname=".DBNAME."", _DBUSER_, DBPASSWD); $db->setAttribute(PDO::ATTRERRMODE, PDO::ERRMODE_EXCEPTION); settimelimit(600); // RESET CYCLE //START $defaultqta = 0; $updateAll = $db->prepare("update ".DBPREFIX."product SET quantity = :defaultqta"); $updateAll->execute(array(':defaultqta'=>$default_qta)); $updateAll = $db->prepare("update ".DBPREFIX."productattribute SET quantity = :defaultqta"); $updateAll->execute(array(':defaultqta'=>$default_qta)); $updateAll = $db->prepare("update ".DBPREFIX."stockavailable SET quantity = :defaultqta"); $updateAll->execute(array(':defaultqta'=>$default_qta)); // END // MAIN CYCLE $rownum = 0; if (($handle = fopen($remotecsvfile, "r")) !== false) { while (($data = fgetcsv($handle, 1000, ";")) !== false) { $rownum++; if ($rownum == 1) { // SKIP FIRST LINE (HEADER) continue; } if ($data[0] == '' || !isnumeric($data[1])) { // SKIP EMPTY VALUES continue; } // INPUT SANITIZATION //$reference =':reference'; //$quantity =':quantity'; $reference = trim($data[0]); $quantity = ($data[1] >= 0) ? $data[1] : 0; try { $res4 = $db->prepare("SELECT id_product, id_product_attribute from "._DB_PREFIX_."product_attribute WHERE reference = :reference"); $res4->execute(array(':reference'=>$reference)); if ($res4->rowCount() > 0) { // IT'S A PRODUCT COMBINATION $row4 = $res4->fetch(); $res = $db->prepare("update "._DB_PREFIX_."stock_available set quantity = :q where id_product_attribute = :id_product_attribute"); $res->execute(array(':q'=>$quantity, ':id_product_attribute'=>$row4['id_product_attribute'])); $res = $db->prepare("update "._DB_PREFIX_."product_attribute set quantity = :q where id_product_attribute = :id_product_attribute"); $res->execute(array(':q'=>$quantity, ':id_product_attribute'=>$row4['id_product_attribute'])); $res = $db->prepare("update "._DB_PREFIX_."stock_available set quantity = quantity + :q where id_product = :id_product and id_product_attribute = 0"); $res->execute(array(':q'=>$quantity, ':id_product'=>$row4['id_product'])); $res = $db->prepare("update "._DB_PREFIX_."product set quantity = quantity + :q where id_product = :id_product"); $res->execute(array(':q'=>$quantity, ':id_product'=>$row4['id_product'])); } else { // IT'S A SIMPLE PRODUCT $res4 = $db->prepare("SELECT id_product from "._DB_PREFIX_."product WHERE reference = :reference"); $res4->execute(array(':reference'=>$reference)); if ($res4->rowCount() > 0) { $row4 = $res4->fetch(); $res = $db->prepare("update "._DB_PREFIX_."stock_available set quantity = :q where id_product = :id_product and id_product_attribute = 0"); $res->execute(array(':q'=>$quantity, ':id_product'=>$row4['id_product'])); $res = $db->prepare("update "._DB_PREFIX_."product set quantity = :q where id_product = :id_product"); $res->execute(array(':q'=>$quantity, ':id_product'=>$row4['id_product'])); } } } catch (PDOException $e) { echo 'Sql Error: '. $e->getMessage() .'<br /><br />'; } } fclose($handle); } ?> ``` example update.csv reference;quantity 39034;43 39035;39 43591-52;4 43591-54;7 43591-56;4 43591-58;8 43591-60;6 43591-62;9 38490;38 37941;36 45399;17 45411;17 44998;16 34897;16 34896;9 40247;9 40717;9 43275;9 46685-50;2 47314;1 43100;1 23667;1 25992;0 48971-54;0 48971-56;0 48971-58;18 48971-60;0 48971-62;0 48971-64;0 48971-66;0 Unfortunately, I no longer have permission to upload files (except images). Hence these variants.
  18. @alwayspaws Suggestion: at your subtitle "Thank you for creating a customer ...." use the same style as "here are your login details" may increase the font size plus 1 or 2 levels
  19. @ukclearance if you missed two tools after migration please read this topic, it helps me from @lesley description https://forum.thirtybees.com/topic/537/index-404-error-after-ps-1-6-1-1-migration/11
  20. @ukclearance From Prestashop I know that with scripts the "literal" must be used. For TB, I had not needed it so far and so I do not know if it might be due to it. ``` {literal} <----u have to add {literal} to add custom javascript inside .tpl file if its tpl file {/literal} ```
  21. @foolab The easiest solution would be to create an additional main category under the start category and then move all other categories into it. (Of course, then all products should be assigned to this category.) With the blocklayered module, customers could then filter. EDIT: for example - name submain-cat -> "all products" and add this to topmenu
  22. I always mark with me all 3 options and then set the primary key for all completely new.
  23. There is still uncertain, if this function will eventually be installed in the core, here's the guide from the PS forum, for those who can not wait or do not know yet. Step 1 go to your database in prefixfeatureproduct all 3 entrys with primary key from this to this step 2 create "Product.php" at folder /override/classes/ ``` <?php /** * Modification Name: Multiple features for Prestashop * Description: Allows the user to select multiple features for a product * Version: 1.6 * Author: Mellow http://www.prestashop.com/forums/user/344943-mellow * Adaptation to Prestashop 1.5.6: David Bucur http://www.tricksfordevelopers.com * Prestashop 1.6 version: Josef Gullstr�m http://www.prestashop.com/forums/user/597992-jgullstr * License: GPL2 */ class Product extends ProductCore { public static function getFrontFeaturesStatic($id_lang, $id_product) { if (!Feature::isFeatureActive()) return array(); if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache)) { // Display multi-valued features as comma-separated values in product // data sheet. self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT name, GROUP_CONCAT(value SEPARATOR \', \') AS value, pf.id_feature FROM '._DB_PREFIX_.'feature_product pf LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.') LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.') LEFT JOIN '._DB_PREFIX_.'feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.') '.Shop::addSqlAssociation('feature', 'f').' WHERE pf.id_product = '.(int)$id_product.' GROUP BY pf.id_feature ORDER BY f.position ASC' ); } return self::$_frontFeaturesCache[$id_product.'-'.$id_lang]; } public function addFeaturesToDB($idfeature, $idvalue, $cust = 0) { // Default behavior. if ($cust || !isarray($idvalue)) { return parent::addFeaturesToDB($idfeature, $idvalue, $cust); } // For multi-value features, build array of rows and insert into db. $base = array( 'id_feature' => (int)$id_feature, 'id_product' => (int)$this->id, ); $rows = array(); foreach ($id_value as $value) { if(!empty($value)) { $rows[] = $base + array('id_feature_value' => $value); } } if(!empty($rows)) { Db::getInstance()->insert('feature_product', $rows); } // From parent. SpecificPriceRule::applyAllRules(array((int)$this->id)); if ($id_value) { return ($id_value); } } } ``` Step 3 create "AdminProductsController.php" at folder /override/controllers/admin/ ``` <?php /** * Modification Name: Multiple features for Prestashop * Description: Allows the user to select multiple features for a product * Version: 1.6 * Author: Mellow http://www.prestashop.com/forums/user/344943-mellow * Adaptation to Prestashop 1.5.6: David Bucur http://www.tricksfordevelopers.com * Prestashop 1.6 version: Josef Gullstr�m http://www.prestashop.com/forums/user/597992-jgullstr * License: GPL2 */ class AdminProductsController extends AdminProductsControllerCore { public function initFormFeatures($obj) { if (!$this->default_form_language) $this->getLanguages(); $data = $this->createTemplate($this->tpl_form); $data->assign('default_form_language', $this->default_form_language); if (!Feature::isFeatureActive()) $this->displayWarning($this->l('This feature has been disabled. ').' <a href="index.php?tab=AdminPerformance&token='.Tools::getAdminTokenLite('AdminPerformance').'#featuresDetachables">'.$this->l('Performances').'</a>'); else { if ($obj->id) { if ($this->product_exists_in_shop) { $features = Feature::getFeatures($this->context->language->id, (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)); // Mellow modification. foreach ($features as $k => $tab_features) { $features[$k]['current_item'] = false; $features[$k]['val'] = array(); $features[$k]['custom'] = true; foreach ($obj->getFeatures() as $tab_products) { if ($tab_products['id_feature'] == $tab_features['id_feature']) $features[$k]['current_item'][] = $tab_products['id_feature_value']; } if (!$features[$k]['current_item']) { $features[$k]['current_item'][0] = null; } $features[$k]['featureValues'] = FeatureValue::getFeatureValuesWithLang($this->context->language->id, (int)$tab_features['id_feature']); if (count($features[$k]['featureValues'])) { foreach ($features[$k]['featureValues'] as $value) { if (in_array($value['id_feature_value'], $features[$k]['current_item'])) { $features[$k]['custom'] = false; } } } if ($features[$k]['custom']) { $features[$k]['val'] = FeatureValue::getFeatureValueLang($features[$k]['current_item'][0]); } } // EOF Mellow modification. $data->assign('available_features', $features); $data->assign('product', $obj); $data->assign('link', $this->context->link); $data->assign('languages', $this->_languages); $data->assign('default_form_language', $this->default_form_language); } else $this->displayWarning($this->l('You must save the product in this shop before adding features.')); } else $this->displayWarning($this->l('You must save this product before adding features.')); } $this->tpl_form_vars['custom_form'] = $data->fetch(); } public function processFeatures() { if (!Feature::isFeatureActive()) return; if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product')))) { // delete all objects $product->deleteFeatures(); // add new objects $languages = Language::getLanguages(false); foreach ($_POST as $key => $val) { if (preg_match('/^feature_([0-9]+)_value/i', $key, $match)) { // "&& $val[0] != 0" added by override. if ($val && $val[0] != 0) { $product->addFeaturesToDB($match[1], $val); } else { if ($default_value = $this->checkFeatures($languages, $match[1])) { $id_value = $product->addFeaturesToDB($match[1], 0, 1); foreach ($languages as $language) { if ($cust = Tools::getValue('custom_'.$match[1].'_'.(int)$language['id_lang'])) $product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $cust); else $product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $default_value); } } } } } } else $this->errors[] = Tools::displayError('A product must be created before adding features.'); } } **Step 4** create "features.tpl" at folder /override/controllers/admin/templates/products/ {* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 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/afl-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 [email protected] 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 [email protected] * @author Josef Gullstr�m http://www.prestashop.com/forums/user/597992-jgullstr * @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} {if isset($product->id)} {l s='Assign features to this product'} {l s='You can specify a value for each relevant feature regarding this product. Empty fields will not be displayed.'} {l s='You can either create a specific value, or select among the existing pre-defined values you\'ve previously added.'} {l s='Feature'} {l s='Pre-defined value'} {l s='or'} {l s='Customized value'} {foreach from=$available_features item=available_feature} {$available_feature.name} {* Changed for multiple-value support *} {if sizeof($available_feature.featureValues)} {foreach from=$available_feature.featureValues item=value} {$value.value|truncate:40} {/foreach} {else} {* /Changed for multiple-value support *} {l s='N/A'} - {l s='Add pre-defined values first'} {/if} {$available_feature.val[1].value|escape:'html':'UTF-8'|default:""} {if $languages|count > 1} {l s='ALL'} {foreach from=$languages item=language} {$language.iso_code} {/foreach} {/if} {foreach from=$languages key=k item=language} {if $languages|count > 1} {/if} {$available_feature.val[$k].value|escape:'html':'UTF-8'|default:""} {if $languages|count > 1} {$language.iso_code} {l s='ALL'} {foreach from=$languages item=language} {$language.iso_code} {/foreach} {/if} {/foreach} {foreachelse} {l s='No features have been defined'} {/foreach} {l s='Add a new feature'} {l s='Cancel'} {l s='Save'} {l s='Save and stay'} {/if} {/literal} ``` product backoffice product frontoffice if you use blocklayered - your customer have more option when you change the features option in the modul
  24. copy your AdminOrdersController.php from /controllers/admin to the folder /override/controllers/admin/ After changing you can see the ordered products with variants on order list. Don´t forget to clear the cache! change this os.`color`, IF((SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new, country_lang.name as cname, to os.`color`, (SELECT GROUP_CONCAT(odd.product_name SEPARATOR ", ") FROM `'._DB_PREFIX_.'order_detail` odd WHERE odd.id_order = a.id_order) as products, IF((SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new, country_lang.name as cname, and change this $this->fields_list = array_merge( $this->fields_list, [ 'total_paid_tax_incl' => [ 'title' => $this->l('Total'), 'align' => 'text-right', 'type' => 'price', 'currency' => true, 'callback' => 'setOrderCurrency', 'badge_success' => true, ], 'payment' => [ 'title' => $this->l('Payment'), ], to ``` $this->fieldslist = arraymerge( $this->fieldslist, [ 'totalpaidtaxincl' => [ 'title' => $this->l('Total'), 'align' => 'text-right', 'type' => 'price', 'currency' => true, 'callback' => 'setOrderCurrency', 'badgesuccess' => true, ], 'products' => [ 'title' => $this->l('Products'), 'havingFilter' => true, 'filterkey' => 'products', ], 'payment' => [ 'title' => $this->l('Payment'), ], ``` before after changing
×
×
  • Create New...