Jump to content

slashdev

Members
  • Posts

    13
  • Joined

  • Last visited

Profile Information

  • First Name
    Alex
  • Last Name
    Shi

Recent Profile Visitors

512 profile views

slashdev's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Collaborator Rare
  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

3

Reputation

  1. Hello everyone. I have good news for you. I've done it. See below how to duplicate product without images: 1. Modification of file /html/src/Adapter/Product/AdminProductDataUpdater.php look for use Validate; and add after it use Tools; look for if (!Image::duplicateProductImages($id_product_old, $product->id, $combination_images)) { and change to if (!Tools::getValue('noimage') && !Image::duplicateProductImages($id_product_old, $product->id, $combination_images)) { 2. Modification of file html/src/PrestaShopBundle/Resources/views/Admin/Product/CatalogPage/Lists/list.html.twig look for this block {% set buttons_action = buttons_action|merge([ { "onclick": "unitProductAction(this, 'duplicate');", "icon": "content_copy", "label": "Duplicate"|trans({}, 'Admin.Actions') } ]) %} and add after it {% set buttons_action = buttons_action|merge([ { "onclick": "unitProductAction(this, 'duplicate noimage=1');", "icon": "content_copy", "label": "Duplicate without images"|trans({}, 'Admin.Actions') } ]) %} 3. Modification of file html/ADMINFOLDER/themes/default/js/bundle/product/catalog.js look for this function and function unitProductAction(element, action) { ... } and do like this (only two changes) function unitProductAction(element, action) { a = action.split(' '); action = a[0]; params = (a.length == 1) ? '' : a[1]; // <-- add this line var form = $('form#product_catalog_list'); // save action URL for redirection and update to post to bulk action instead // using form action URL allow to get route attributes and stay on the same page & ordering. var urlHandler = $(element).closest('[data-uniturl]'); var redirectUrlHandler = $(element).closest('[redirecturl]'); var redirectionInput = $('<input>') .attr('type', 'hidden') .attr('name', 'redirect_url').val(redirectUrlHandler.attr('redirecturl')); switch (action) { case 'delete': // Confirmation popup and callback... $('#catalog_deletion_modal').modal('show'); $('#catalog_deletion_modal button[value="confirm"]').off('click'); $('#catalog_deletion_modal button[value="confirm"]').on('click', function () { form.append($(redirectionInput)); var url = urlHandler.attr('data-uniturl').replace(/duplicate/, action); form.attr('action', url); form.submit(); $('#catalog_deletion_modal').modal('hide'); }); return; // Other cases, nothing to do, continue. //default: } form.append($(redirectionInput)); var url = urlHandler.attr('data-uniturl').replace(/duplicate/, action) + (params.length > 0 ? '&' + params : ''); // <-- and change this line form.attr('action', url); form.submit(); } 4. Clear cache in Performance and clear your browser cache. That's all. Have good clients $)
  2. For Prestashop 1.7 To move down category description you need move this code {if $category.description} <div id="category-description" class="text-muted">{$category.description nofilter}</div> {/if} from \themes\your_themes\templates\catalog\_partials\category-header.tpl to bottom of file \themes\your_themes\templates\ _partials\products-bottom.tpl Important! For some themes you need modify ...\catalog\listing\category.tpl instead ...\catalog\_partials\category-header.tpl
  3. Hello everybody. I need to automatically add paid (not free) package to cart after checkout. I’m looking for hook. Does anybody know what is name of hook?
  4. Does anybody have any idea how automatically add some product to cart after checkout?
  5. Hello I'm looking for a hook after showing first step order confirmation for add some virtual product/service if order amount less some amount. Help plz.
  6. See this link https://support.google.com/tagassistant/answer/2947038?hl=en#cdata_comments
  7. Thanks for a tip but this solution solve a part of problem. I noticed that CDATA-section is missing when "Minify HTML" is ON. I was looking for a long time and I found function that removed this section. It's called _removeScriptCB. I made changes and everything is Ok. find and comment: $js = $this->_removeCdata($js); add before: $existsCdata = (false !== strpos($js, '<![CDATA[')) ? 1 : 0; find and edit: return $this->_reservePlace($this->_needsCdata($js) && !$existsCdata ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}" : "{$ws1}{$openScript}{$js}</script>{$ws2}"
  8. Fragment of result page: <script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js"></script> ... <script type="text/javascript"> /* <![CDATA[ */; var google_conversion_id = 999999999; ... /* ]]> */ </script> Javascript conversion.js called before variables that will be declared.
  9. Hello community. I have next configuration in my shop: Smart cache for JavaScript - ON Minify HTML - ON Compress inline JavaScript in HTML - ON Move JavaScript to the end - ON I use hook DisplayOrderConfirmation in my module and display some tpl file that contains this code: <!-- Google Code for Purchase Conversion Page --> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 999999999; var google_conversion_language = "en_US"; var google_conversion_format = "1"; var google_conversion_color = "555555"; var google_conversion_label = "xxx_XxXxXx"; var google_remarketing_only = "false"; /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <img height=1 width=1 border=0 src="//www.googleadservices.com/pagead/conversion/999999999/?value=9&currency_code=USD&label=xxx_XxXxXx&guid=ON&script=0"> </noscript> but block of variable declaration follows after calling script conversion.js on result page. I need help guys.
×
×
  • Create New...