Hot answers tagged

33

Working solution. Just create or edit requirejs-config.js file from below path. /app/code/Namespace/Module/view/frontend/requirejs-config.js And place below code in requirejs-config.js var config = { map: { '*': { 'Magento_Payment/template/payment/cc-form.html': 'Namespace_Module/template/payment/cc-form.html' ...


16

The question is in fact, how do you change the number of product columns. The line you wish to change is generated by this code: <?php $_columnCount = $this->getColumnCount(); ?> <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col"> that you can find in this file: app\design\frontend\Your_Package\Your_Theme\...


14

You can just add your cc-form.html file inside your theme payment module. <mage_dir>/app/design/frontend/{Package}/{themename}/Magento_Payment/web/template/payment/cc-form.html You can change according to your requirements at above place. Remove var folder from root and remove pub/static/frontend folder. You must have run command php bin/magento ...


13

Try to put this in .htaccess <ifModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 2 days" ExpiresByType image/x-icon "access plus 2592000 seconds" ExpiresByType text/html "access plus 1 seconds" ExpiresByType image/gif "access plus 2592000 seconds" ExpiresByType image/jpeg "access plus 2592000 seconds" ...


13

I managed to do this in app/design/frontend/<Vendor>/<Theme>/Magento_OfflinePayments/web/template/<Filename>.html, but the solution should work in the Magento_Checkout as well. When you inspect the window variable in the dev-console of your browser, you will see that the checkout and checkoutConfig objects are available on checkout-pages. ...


10

Correct Location The correct location in this example is actually the first one I tried, I just didn't clear the directories required. So to overwrite lib templates they need duplicating in to the theme directory excluding the lib directory. Correct location -app/design/frontend/**VENDOR**/**THEME**/web/mage/gallery/gallery.html Clear pub/static and var/...


10

You should write a below code for else condition <!-- ko if: isFreeShipping() --> //My Code goes here <!-- /ko --> <!-- ko ifnot: isFreeShipping() --> //My Code goes here <!-- /ko -->


9

Accepted solution is right, but I copy here the full @AntonGuz answer from the "Stack Overflow" (very well explained): Yes, there is. You can look in pub static to see how path to static asset constructed. How it works Every asset is accessible from the page by itenter code heres "RequireJS ID". It similar to real path, but varied. For ...


8

...at some point magento will need to ... stream it's html data to the client. At what point does this happen? See Mage_Core_Controller_Varien_Front::dispatch() - there's a code comment which answers your question directly: public function dispatch() { //(snip...) // This event gives possibility to launch something before sending output (allow ...


7

First you need to know, how your website is identifiable as magento, as there are a big number of possible proves. basic html structure magento specifiv css special js code on product views (assuming you already obfuscate the js files) some routes special for magento headers and html head some file locations usually accessible (licence file, skin path, /js ...


7

You can do this with a sql query. But First you need to identify the attribute ids for your attributes and their types. SELECT attribute_id, attribute_code, backend_type FROM eav_attribute WHERE attribute_code IN ('weight', 'general_weight') AND entity_type_id = (SELECT entity_type_Id ...


7

First of all, we need to read here: http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/templates/template-email.html#non-inline-styles. For the Non Inline Styles, they must be in a <style type="text/css"></style> tag for them to work. In your case, we only need to include the header {{template config_path="design/email/header_template"}} ...


6

You can use the event controller_action_layout_render_before if you want to alter the html for all the pages. If you want it for a specific page page use the event controller_action_layout_render_before_[module_name]_[controller_name]_[action_name]. For example for the product view page the event is controller_action_layout_render_before_catalog_product_view,...


6

The file is app/design/frontend/{package}/{theme}/template/page/html/breadcrumbs.phtml As a future reference, when you cannot find a template, turn on the template path hints


5

Solution 1. Best solution: Less Javascript or find out which JS loads the part 'above the fold' and Solution 2. load that in header + de rest of the JS in footer Solution 3. or use the attribute for the JS below the fold, which prevents parsing from blocking the initial page load by deferring it until the browser's UI thread is not busy doing something ...


5

Configure another domain for skin and media check that the cookie domain is configured that way, that the cookies are not send along these domains Make sure, that you don't get a problem with the JS due to "same origin policy" UPDATE set the media, skin and js url to your new domain: System > Config > Web > Unsecure/Secure > Base Media URL System > Config ...


5

It is generated from this file: app\design\frontend\base\default\template\catalog\product\compare\list.phtml You can copy this to your theme's folder and make changes. You can get the view files that is generating each blocks in the frontend by enabling the Template Path hints in. Select the Main website in the configuration and select this: System-> ...


5

I think you'll find all the necessary info here: How to override config.xml Don't forget to clear the cache and create a new contact email template in the admin (or delete them to use the default HTML template from /app/locale/xx_YY/template/email), as the changes will be visible only in this case.


5

First of all, we need to add Constructor injection method to our custom select class: (Edit: we don't need to add Constructor Injection, we need to add the sequence module) <?php namespace Mike\Newselect\Block\Product\View\Options\Type; class Select extends \Magento\Catalog\Block\Product\View\Options\Type\Select { public function ...


5

Check deploy mode, If deploy mode is not developer mode then set it. php bin/magento deploy:mode:set developer Check .htaccess is in pub/static/ folder or not. If not then please take from fresh magento and add it. Delete this file pub/static/frontend/<vendor>/<theme>/Magento_Checkout/web/template/cart/totals.html Deploy static content rm -rf ...


5

There are three parts to this, I will use the checkout authentication as an example but this should work in any KO/JS file that has mage/url as a dependency. vendor/magento/module-checkout/view/frontend/web/js/view/authentication.js vendor/magento/module-checkout/view/frontend/web/template/authentication.html Setting up the URL in the JS file Add mage/url ...


5

Just to extend a bit on Suresh Chikani's answer to include more combinations under this question: To do a if-elseif-else construction you would have in PHP: if (A && B) { //...code } elseif (A) { // And thus 'not B' //...code } else { // Thus is 'not A' and 'not B' //...code } In Knockout you would do: <!-- ko if: A && B --&...


5

Just create or edit requirejs-config.js file from below path. app/code/Namespace/Module/view/frontend/requirejs-config.js And place below code in requirejs-config.js var config = { map: { '*': { 'Magento_Payment/template/payment/cc-form.html': 'Namespace_Module/template/payment/cc-form.html' } } }; So we ...


4

You have to change the root template for <catalog_category_default> and <catalog_category_layered> inside your local.xml i.e. <catalog_category_default> <reference name="root"> <action method="setTemplate"><template>page/2columns-left.phtml</template></action> </reference> </...


4

I don't know since which version of Magento2 it is required but if you want to override template from Magento_Ui module, you need to provide path like this: var config = { map: { "*": { 'ui/template/form/element/select.html':'Vendor_Module/templates/form/element/select.html' } } }; Because in this file: vendor/...


4

You need to change the doctype in the following files: app/design/frontend/<your_package>/<your_theme/page/1column.phtml app/design/frontend/<your_package>/<your_theme/page/2columns-left.phtml app/design/frontend/<your_package>/<your_theme/page/2columns-right.phtml app/design/frontend/<your_package>/<your_theme/page/...


4

Update your code with below code <?php $category = Mage::registry("current_category"); if($category->getId()){ $categories = $category->getCollection() ->addAttributeToSelect(array('name', 'image')) ->addAttributeToFilter('is_active', 1) ->addIdFilter($category->getChildren()) ?>...


3

Simple solution would be to use Javascript. Since prices are wrapped in a span tag with some class/id. You can read those values and convert it to arabic number using window load event. For english to arabic number conversion You can use some jQuery plugins: http://www.jqueryscript.net/other/jQuery-Plugin-To-Convert-English-Numbers-To-Persian-persianumber....


3

You don't control the domains www.someextensionsite.com static.someextensionsites.com therefore you can't do anything to fix this error.


3

Main idea here is to move all javascript to the bottom. Create observer on http_response_send_before: <frontend> <events> <http_response_send_before> <observers> <goivvy_deferjs_http_response_send_before> <class>goivvy_deferjs/observer</class> <type>singleton</type> ...


Only top voted, non community-wiki answers of a minimum length are eligible