texts: Extend saveShippingInformation js in Magento 2

texts:
I am building a module for Magento 2. I extend the saveShippingInformation in Magento 2 to add my custom field
var config = {
    "map": {
        "*": {
            'Magento_Checkout/js/model/shipping-save-processor/default': 'My_Module/js/model/shipping-save-processor/default'
        }
    }
};

// Custom shipping-save-processor, I added the new extension_attributes to addressInformation
define(
    [
        'jquery',
        'ko',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/resource-url-manager',
        'mage/storage',
        'Magento_Checkout/js/model/payment-service',
        'Magento_Checkout/js/model/payment/method-converter',
        'Magento_Checkout/js/model/error-processor',
        'Magento_Checkout/js/model/full-screen-loader',
        'Magento_Checkout/js/action/select-billing-address'
    ],
    function (
        $,
        ko,
        quote,
        resourceUrlManager,
        storage,
        paymentService,
        methodConverter,
        errorProcessor,
        fullScreenLoader,
        selectBillingAddressAction
    ) {
        'use strict';

        return {
            saveShippingInformation: function () {
                var payload;

                if (!quote.billingAddress()) {
                    selectBillingAddressAction(quote.shippingAddress());
                }

                payload = {
                    addressInformation: {
                        shipping_address: quote.shippingAddress(),
                        billing_address: quote.billingAddress(),
                        shipping_method_code: quote.shippingMethod().method_code,
                        shipping_carrier_code: quote.shippingMethod().carrier_code,
                        extension_attributes:{
                            fee: $('[name="fee"]').prop("checked")
                        }
                    }
                };

                fullScreenLoader.startLoader();

                return storage.post(
                    resourceUrlManager.getUrlForSetShippingInformation(quote),
                    JSON.stringify(payload)
                ).done(
                    function (response) {
                        quote.setTotals(response.totals);
                        paymentService.setPaymentMethods(methodConverter(response.payment_methods));
                        fullScreenLoader.stopLoader();
                    }
                ).fail(
                    function (response) {
                        errorProcessor.process(response);
                        fullScreenLoader.stopLoader();
                    }
                );
            }
        };
    }

My question is: Is this a bad practice to override the magento js like this? What if the merchant's theme overrides this js, it's gonna override my js too, right? In that case, how can I add custom field to addressInformation module


texts: Why can't I access my custom cache key via CLI when it was set through a web request?

texts:
I have a method that calls the following code from a web request.

Mage::app()->getCache()->save('bar', 'foo', array(), 60*5);

I have another method that calls

Mage::app()->getCache()->load('foo');

The method that loads the cached value returns the correct value when called via a web request, but always returns false when I run the code via the CLI.

The reason that I'm trying to run via the CLI is that the code in question is part of a cron task. I'm using n98-magerun sys:cron:run foobar_cron to run the code.

My initial thought was that maybe running from the CLI would initiate a different store view, but I've stepped through the code and haven't found anything like that.

Trying to get the cached value when running via the web through admin works.

I'm using the standard Magento filesystem cache, and don't have any custom cache settings in my local.xml. Running EE 1.12.0.2.

I would expect that when I set a cache key via a web request that I could access the same value when running via the CLI and vice verca. Why isn't this working as expected, and what can I do to fix it?


texts:
I create simple unit test with object manager with class name

  $objectManager = new  \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)

and object Name ModuleList like

  $moduleList = $objectManager->getObject(ModuleList::class);

    print_r($moduleList->getAll());

but not getting all module list

this my unitTest file give below

namespace NameSpaceModule\Test\Test\Unit;

use Magento\Framework\Module\ModuleList;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\TestCase;

class SampletTest extends TestCase
{
    private $moduleName = 'NameSpaceModule_Test';

    public function testTheModuleIsConfiguredAndEnabled(){
        /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager $objectManager */
        $objectManager = new ObjectManager($this);

        /** @var ModuleList $moduleList */
        $moduleList = $objectManager->getObject(ModuleList::class);

        print_r($moduleList->getAll());
    }
}


texts: Change order or tabs on product details page on Magento 1.9

texts:
How do you change the order of the tabs on the product details page.

I created a new tab called 'Programs' by adding the below to my local.xml

<catalog_product_view translate="label">
    <reference name="product.info">
        <block type="catalog/product_view_description" name="product.programs" as="programs" template="catalog/product/view/programs.phtml">
            <action method="addToParentGroup"><group>detailed_info</group></action>
            <action method="setTitle" translate="value"><value>Programs</value></action>
        </block>
    </reference>
</catalog_product_view>

I aslo created a catalog/product/view/programs.phtml template in my theme.

In addition I created another tab called ingredients

Now I have 3 tabs on my product details page i.e. Description, Reviews, Programs & Ingredients.

How can I change the order to Programs Description Ingredients and Reviews?

Also, how can I link my the templates I created for these new tabs to a product attribute?


texts:
How to set page title to have html on it E.G

$this->pageConfig->getTitle()->set(__('Your'.html_entity_decode(' Page'). 'Title'));

That's ain't working! Anyone know how thanks in advance


texts: Magento 2: Add the Logout button in Customer My Account

texts:
How can I add the Logout link in Customer My Account using the authorization-link in the body of ../Magento_Customer/layout/customer_account.xml?

I want to add this block:

to customer_account.xml to show logout link in my account, in main column of this view, the bottom of all


texts: Magento 2: How to get quantity to ship from when shipping the order?

texts:
I want to get the quantity to ship when i click on submit shipment botton. Following is the image and the array i got.

code:

$qtyShipped = $this->getRequest()->getParam('shipment');
var_dump($qtyShipped);

It gives output as

array(2) { ["items"]=> array(1) { [31]=> string(1) "3" } ["comment_text"]=> string(0) "" }

value 31 is changing for each order. Please help me to solve this.

Thanks.


texts: Custom JavaScript not working in Magento 2

texts:
I'm trying to call my custom JavaScript function in addtocart.phtml file, but it's not working.

After user clicked add to cart button, I'm calling my custom JavaScript function using , but not woring. For this, I tried below code.

Added below code to addtocart.phtml file from app/design/frontend/Vendor/Theme/Magento_Catalog/templates/product/view

<?php if ($block->isRedirectToCartEnabled()) : ?>
<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "Magento_Catalog/product/view/validation": {
                "radioCheckboxClosest": ".nested"
            },
            "ABCSolutions_CustomModule/js/custom": {

            }
        }
    }
</script>
<?php else : ?>

And Custom Js file

define([
    "jquery",
    'Magento_Customer/js/customer-data',
    "jquery/ui"
], function($,customerData) {
    "use strict";
    //creating jquery widget
    $.widget('mage.custom', {
        _create: function() {

            //bind click event of elem id
            this.element.on('click', function(e){
                console.log('Click ME!');
                console.log(customerData.get('customer'));
            });
        }

    });

    return $.mage.custom;
});

I tried both category and product page it's not working. Could you please suggest us to work above code for both pages after add to cart button clicked.


texts: How to get orders based on custom attribute value of product?

texts:
I have a Custom attribute name ( product string ) on Product in which i have save a string i want to get those orders which will have that product string of same value.
I will get the product by :
$collection = $this->_orderCollectionFactory->create()
            ->addAttributeToSelect('*')
            ->setOrder('created_at','desc');
return $collection;


texts: Space added before every magento page content

texts:
Since upgrading to 1.9.2.2, every magento page on my store is pre-padded with a space before the page content.
This breaks xml pages such as the magento soap api, giving the following error when loaded in the browser:

This page contains the following errors:

error on line 1 at column 8: XML declaration allowed only at the start of the document

Below is a rendering of the page up to the first error.

I found that the minimal code required for the spaces to be added is the following:

<?php
require_once 'app/Mage.php';
require_once 'app/code/core/Mage/Core/Model/Config/Options.php';

How can I find the point where the padding occurs?


texts: Magento 2 Page Builder was rendering for 5 seconds without releasing locks

texts:
Unable to CMS pages and block if having content from page builder after upgraded from 2.3.1 to 2.3.5 p2 version
spinner showing continuously and getting error in console as "Page Builder was rendering for 5 seconds without releasing locks"
Could you please advise any one


texts: When does an order ID get reserved in Magento 2?

texts: When does Magento 2 determine which customer gets the next consecutive order ID? Is it yielded from the quote entity_id or does it assign to whichever order is completed first?


texts: How to change the template for bundled product options in Magento 2?

texts:
In price-bundle.js there is a function:

        ...
    _applyOptionNodeFix: function applyOptionNodeFix(options) {
        ...

Which cleans up the dropdowns and templates the data.

I would like to add to this template to include the inventory number on the stock.

I ave managed to add the inventory to the options in the select on the intial server response so I would now want to add that value to toTemplate.data.

I also want to change the template so it looks like:

"<%- data.label %><% if (data.finalPrice.value) { %> +<%- data.finalPrice.formatted %><% } %>" ( <%- data.stock_level_label %>)

instead of

"<%- data.label %><% if (data.finalPrice.value) { %> +<%- data.finalPrice.formatted %><% } %>"

How can this be done?

The full function is:

/**
 * Helper to fix issue with option nodes:
 *  - you can't place any html in option ->
 *    so you can't style it via CSS
 * @param {jQuery} options
 * @private
 */
_applyOptionNodeFix: function applyOptionNodeFix(options) {
    var config = this.options,
        format = config.priceFormat,
        template = config.optionTemplate;
    template = mageTemplate(template);
    options.filter('select').each(function (index, element) {
        var $element = $(element),
            optionId = utils.findOptionId($element),
            optionName = $element.prop('name'),
            optionType = $element.prop('type'),
            optionConfig = config.optionConfig && config.optionConfig.options[optionId].selections;

        $element.find('option').each(function (idx, option) {
            var $option,
                optionValue,
                toTemplate,
                prices;

            $option = $(option);
            optionValue = $option.val();

            if (!optionValue && optionValue !== 0) {
                return;
            }

            toTemplate = {
                data: {
                    label: optionConfig[optionValue] && optionConfig[optionValue].name
                }
            };
            prices = optionConfig[optionValue].prices;

            _.each(prices, function (price, type) {
                var value = +(price.amount);
                value += _.reduce(price.adjustments, function (sum, x) {
                    return sum + x;
                }, 0);
                toTemplate.data[type] = {
                    value: value,
                    formatted: utils.formatPrice(value, format)
                };
            });

            $option.html(template(toTemplate));
        });
    });
},


texts:
Hoping someone's come across this before. I'm trying to get some javascript added to a phtml file in Magento 2, but instead of interpreting it as javascript it seems to be outputting it as plain text.

Initially I tried to get it working by using the usual javascript tags in the template file

<script type="text/javascript">
        $("#countdown-before")
            .countdown("<?php echo $this->start;?>", function(event){
                $(this).text("<?php echo $this->beforeMessage;?>" + event.strftime('%H:%M:%S'));
            })
</script>

When this output straight to the page I did some research and tried formatting it using reactjs, but had the same problem (not parsing the script tag and instead outputting as text)

<script>// <![CDATA[
        require([
            'jquery'
        ], function ($) {
            console.log('hello world');
        });
    // ]]>
</script>

Is there something I'm missing which is needed with Magento 2 in order to include javascript directly in the template page?

Thanks in advance

edit: Couple of extra details I realised might affect this. The issue is happening on an Enterprise Edition installation and the template file this is stored in is loaded via a widget. Don't know if maybe there's some sanitisation being applied because it's a widget and that's maybe what's breaking it


texts: I am trying to edit Shopping Cart is Empty page. But I am unable to . I am editing  checkout/cart/noItems.phtml in template directory. I tried to editby writing a "test" in html and also echoing via php, but nothing shows in front end


texts: Multi Store mobile says too many redirects

texts:
Multi store states to many redirects to clear cookies only on mobile version

so i added the following to the .htaccess and the mobile version works again

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !(iPhone|iPad|iPod|MSIE.*Windows\ NT|Lynx|Safari|Opera|Firefox|Konqueror|Chrome|Opera\ Mini|SymbianOS|Mobile)
RewriteRule (.*) - [F]

this is a total hack, anyone has any ideas on how to properly fix this?


texts: Magento Product Addtocart go to Checkout Page by skipping Cart Page gives suggested Tutorial or any information

texts: Please suggest a tutorial or any example on how to change exciting controller using local folder and local code. I want change in cart controller. I do when click on Add To Cart then it redirects to checkout page. Please Tell What I change and How to change. I am making cart controller override. It's working, but what can change in this controller to direct redirect to check out page.


texts: Magento2 : CMS page images showing in admin but not on front-end (WYSIWYG)

texts:
My CMS images are showing in admin but not on the frontend for a content page (About Us) that I m making

Though the links look clearly wrongly pathed :-
https://www.giftshop.com/index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvRW5ncmF2aW5nL0VuZ3JhdmluZy5qcGcifX0,/key/f2971f3ee5d09c91bd6474c0bec027d7/

Can i get some help to fix this issue?
Thanks in advanced!


texts: Upgrade from CE v1.9.0.1 to CE v.1.9.1.0

texts:
I have just scanned through the update documentation, but I'm not quite sure. Is the update from CE v1.9.0.1 to CE v.1.9.1.0 as easy as just using

System >> Magento Connect >> Magento Connect Manager >> Manage Existing Extensions >> Check for Updates >> (mark all available updates) >> Commit Changes

in the back office? Or are there additional steps (like database upgrade) necessary?

I only want to update my development environment, not a live shop, so I don't care about additional steps of backups, testing the upgrade on a copy or the likes. I'm still a Magento newbie so please excuse if that process is supposed to be straight forward.

Thanks for your help.


texts: how to add products which can be ordered in any length

texts:
I need to create a system where the length is selectable by the user and then price is calculated on tubing.

The length ranges from 1m to 10m and can be ordered in 0.25 segments (i.e 3.75). It also has a colour option.

The length changes price and weight, colour changes nothing. I guess I can charge a fixed price for weight so maybe disregard this.

I've been reading about configrable products but dont think this is the answer because of the variations involved.

What are my options?

Thanks


texts: Image upload error. unable to create directory

texts:
I am very new to magento. I have created one magento store, that is working fine in the localhost. But in server it's working fine except product image upload. I can able to create new product but product images are not uploading. I got this error:

  unable to create directory /var/www/vhosts/.../httpdocs/media/tmp/catalog/product/...

Please refer the following screenshot.

Tried out following:

Checked the /media folder permission that is in 777
Changed the php_value memory_limit 128M to 256M in .htaccess
GD library is installed
Changed attribute scope of small image, large image, thumbnail scope (panel -> Catalog -> Attributes -> Manage attributes) from stroe view to global
Tried this http://marius-strajeru.blogspot.in/2011/09/upload-issue-for-magento-1600.html link.

Still am not get any solution. It wasted my time around 2 days.

Please any one help me.


texts: Update Magento Inventory from API Response

texts:
We have an API that we check with on Catalog/Product/View page load. This API returns the current inventory quantities for all the simple products associated with the configured product being loaded.  Then we save these quantities to the database.

            // update the products which were returned in the response
    foreach ($this->_stockByUpcId as $upc => $available) {
        $product = Mage::getModel('catalog/product')->loadByAttribute('upc_identifier', $upc);
        if ($product && $product->getId() && $product->getUpcIdentifier() == $upc) {
            $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());
            $stockItem->setData('qty', $available);
            $stockItem->setData('is_in_stock', $available > 0);
            $stockItem->save();
        }
    }

The problem is this is taking way too much time, on the order of 10-40 seconds. Any ideas or ways to improve the speed of this process?


texts:
We would like to add a Shopping Cart Rule whereby the customer adds a coupon/voucher code to the checkout page.
And this would remove the TAX from selected products, these products would be Tax free.
I have worked out that I can apply a % discount, to the including tax price etc, but that does not make the product Tax Free, just cheaper.
Any ideas?


texts:
I am having problems with httpd full memory usage and we are trying to find the cause.
We have installed Redis and Full Page Cache, we have run this command

  redis-cli monitor

and we see thousands of the messages of the screenshot, where are?
Thanks


texts: how to switch cart items & totals table?

texts:
how to switch positions of cart items & totals table, move cart items to the top and then totals table to the bottom

and how to debug "elems()" sequence?

Thanks


texts: Extension Installation Readiness Check Error Magento 2.3.1

texts:
There are several errors when I'm trying to install an extension (Slider Banner Module) for the first time. The picture below shows the error in the readiness check. I'm using GoDaddy > C-Panel > Magento 2.3.1 on Windows 10 with PHP version 7.2

1) For the Check Cron Scripts errors, I am able to solve it by manually change

$setupCheck = $this->cronScriptReadinessCheck->checkSetup();

$updaterCheck = $this->cronScriptReadinessCheck->checkUpdater();

to

$setupCheck = ['success' => 1];

$updaterCheck = ['success' => 1];

I'm not sure if that is the correct way to fix it since there are no .setup_cronjob_status and .update_cronjob_status files in var.

2) For the Dependency error, I have tried to remove "require-dev": in composer.json file but the error still persist.

3) For the PHP Settings Check error, I tried to change the memory limit in .user.ini and .htaccess from memory_limit = 756M to memory_limit = 2G, however, the C-Panel > PHP Selector > Options > Memory_limit still stays at 756M.

4) PHP Extensions Checks is as the picture below (Default Value)


texts: Magento2 Getting error as variable @baseUrl is undefined in file /var/view_preprocessed

texts:
On doing php bin/magento setup:static-content:deploy -f

I am getting error

  Compilation from source:
  vendor/magento/theme-frontend-blank/web/css/email-inline.less variable
  @baseUrl is undefined in file
  var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/_email-extend.less
  in _email-extend.less on line 19, column 13 17| // as the latter will
  cause font rendering issues if the web fonts are inaccessible. 18| 19|
  @import url("@{baseUrl}css/email-fonts.css");

Final Error

  [Magento\Framework\Exception\FileSystemException]   Cannot read
  contents from file
  "/pub/static/frontend/Magento/blank/en_US/css/email-inlin   e.css"
  Warning!file_get_contents(pub/static/frontend/Magento/blank/en_US/css/email-inli
  ne.css): failed to open stream: No such file or directory

I followed this process

Remove pub/static [Keep the .htaccess backed up and copy it again]
Remove var/cache
Remove var/composer_home
Remove var/generation
Remove var/page_cache
Remove var/view_preprocessed
run php bin/magento setup:static-content:deploy

But getting the same error, Dont know whats is wrong


texts:
I have a custom import of stock from a CSV file, if I have a small number of products to update, it works fine.
But When I have 2400 (like I have here and now), the gateway times out.
The code looks like this, and I am executing it one item at the time.
$productToUpdate = $this->stockRegistry->getStockItemBySku($product->Ean);
$productToUpdate->setQty($product->Stock);
$productToUpdate->setIsInStock((bool)$product->Stock);
$this->stockRegistry->updateStockItemBySku($product->Ean, $productToUpdate);

The last time I made something like this, I updated the database directly due to the speed issues, and then rebuilt the stock index.
But isn't it possible to do it "the right way" and disable the update actions while updating, so I can run the updates and then the "post-update actions"?


texts: Magento2: gettig error in git while running upgrade command

texts:
I am getting issue after running upgrade command.

The "/mnt/data/home/abc/vdmmezbtxm/public_html/generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php" file can't be deleted. Warning!unlink(/mnt/data/home/abc/vdmmezbtxm/public_html/generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php): Permission denied The "/mnt/data/home/abc/vdmmezbtxm/public_html/generated/code/Magento/Framework/App/ResourceConnection/Proxy.php" file can't be deleted. Warning!unlink(/mnt/data/home/abc/vdmmezbtxm/public_html/generated/code/Magento/Framework/App/ResourceConnection/Proxy.php): Permission denied The "/mnt/data/home/abc/vdmmezbtxm/public_html/generated/code/Magento/Framework/ObjectManager/Config/Reader/Dom/Proxy.php" file can't be deleted. Warning!unlink(/mnt/data/home/abc/vdmmezbtxm/public_html/generated/code/Magento/Framework/ObjectManager/Config/Reader/Dom/Proxy.php): Permission denied

Also getting error php bin/magento list

In ServiceManager.php line 1130:

  An abstract factory could not create an instance of magentosetupconsolecomm
  andbackupcommand(alias: Magento\Setup\Console\Command\BackupCommand).

In ServiceManager.php line 941:

  An exception was raised while creating "Magento\Setup\Console\Command\Backu
  pCommand"; no instance returned

In Di.php line 865:

  Missing instance/object for parameter maintenanceMode for Magento\Setup\Con
  sole\Command\BackupCommand::__construct

In ServiceManager.php line 1130:

  An abstract factory could not create an instance of magentoframeworkappmain
  tenancemode(alias: Magento\Framework\App\MaintenanceMode).

In ServiceManager.php line 941:

  An exception was raised while creating "Magento\Framework\App\MaintenanceMo
  de"; no instance returned

In ClassReader.php line 19:

  Class Magento\Framework\App\ResourceConnection\Interceptor does not exist

please check


texts: Magento 2: Are there Downsides to Omitting the `new` Keyword for Magento's Javascript Objects?

texts:
I've just discovered that Magento 2's UI Component javascript constructor functions are built in such a way that they (seem to?) behave the same with, and without, the new keyword;

UiElement = requirejs('uiElement');

//both instantiate a new object
object = new UiElement;
object = UiElement():

However, the UI Component registering code

#File: vendor/magento//magento2-base/lib/web/mage/layout.js
function initComponent(node, Constr) {
    var component = new Constr(_.omit(node, 'children'));

    registry.set(node.name, component);
}

appears to use the new keyword when instantiating these objects.

Does anyone know if there's a downside to not using the new keyword?  The object system seems to have been designed such that you can use these constructor functions either way.  However, without any core example or solid documentation on the topic, it leaves me wondering if this second, new-less syntax is safe to use.

Hoping someone here knows the answer or can pass me on to someone who does.


texts: Magento 2 How to get customer info on resetpasswordpost controller?

texts:
Magento 2 How to get customer info on customer/account/resetpasswordpost controller?

I am trying this code -

echo "<pre>";
print_r($this->session->getData());

and getting this response only -

Array
(
    [wishlist_item_count] => 0
    [rp_token] => XH3BujdKNmcJpc1GQbChU8oYQbwTtiYv
    [no_referer] => 1
)

I need to redirect to my custom pages according to customer needs.

For example -
If customer group is 1 then redirect to xyz page.

If customer group is 2 then redirect to abc page.


texts: I'm cancelling order via Magento Soap API, for some reason emails sent are using default/default templates/skin etc. Is it possible to select which template/skin is used for emails?


texts:
I have successfully managed to configure page caching by Redis on my Magento 2 store but Session Storage doesn't appear to be working.

I have used this code : http://devdocs.magento.com/guides/v2.0/config-guide/redis/redis-session.html

In Magento 1 we had to set RedisSession.xml to active. Does something similar need to be done on Magento 2 ?


texts: Code Pattern to Define and Use Javscript Callbacks / Hooks

texts:
We are using a third party module, that updates prices via AJAX on product / category pages. No we have to react on this update, to update some custom pricing logic.

Of course we do not want to patch the third party module to insert our code, but to send the vendor a patch with can be generally included.

I was thinking about something like this:

1) Ask the vendor to include some kind of hook

if (typeof prices_changed_hook === 'function') {
    prices_changed_hook();
}

2) Define in our code the function globally

But this does not seem like a clean approach. What is a better one?

I tried also to use the jQuery('contentUpdated') event, but without luck.


texts:
I have a little problem resizing images, the files charged on magento are something like 2500x2000 and i would resize that charged images to transform in something like 500x500.
I have two phtml that shows catalogs and products images each one in his own div. Here we are the code :
CATEGORIES
<div class="_engie_categories_ <?= $this->getData('superClass'); ?>">
    <?php foreach ($this->getCategories() as $category) : ?>
        <?php $url = $category->getImageUrl() != '' ? $category->getImageUrl() : 'http://URL_OF_A_DEFAULT_IMAGE' ?>
        <div class="item" data-id="<?= $category->getId(); ?>">
            <img src="<?= $url; ?>" alt="<?= $category->getName(); ?>"/>

<?= $category->getName(); ?>

    <?php endforeach; ?>

PRODUCTS
<?php
/**
 * @var \Magento\Catalog\Model\Product $product
 * @var \Magento\Framework\View\Element\Template $this
 */

$baseImageUrl = $this->getBaseUrl() . "media/catalog/product";
?>

<div class="_engie_products_ <?= $this->getData('superClass'); ?> row">
    <?php foreach ($this->getProducts() as $product) : ?>
        <?php $url = $product->getImage() != '' ? $product->getImage() : 'http://URL_OF_A_DEFAULT_IMAGE' ?>

            <a href="<?= $product->getUrlInStore() ?>">
                <img src="<?= $baseImageUrl . $url; ?>" alt="<?= $product->getName(); ?>"/>

<?= $product->getName(); ?>

    <?php endforeach; ?>

i've tried different solutions, like trying the \Magento\Catalog\Helper\Image , or also other solutions from :

Magento 2: How to get resize image for Custom Module?
https://www.rakeshjesadiya.com/resize-custom-image-in-magento-2/
https://www.rakeshjesadiya.com/how-to-resize-product-image-in-magento-2/
How to resize Image in Magento 2?

but nothing has worked in my case :(
Someone could help me to find a solutions? thank u in advice guys


texts:
Hey guys so I am just wondering what would be the best way to manage multiple stores on one server.

So I have noticed that it is becoming very hard to keep updating all of my sites with changes. Most of the sites use exactly the same setup such as the same admin settings.

When I want to make a change to all of my sites this becomes an issue because if I want to update my Magento version on all of my stores I need to do this manually for each one.

Is there a way to possibly make all of these sites run off the same core code? I do not want to share the same catalog with each store though.

Any help on tips for running multiple stores would be great.

Thanks, Nick


texts: I have tried everything, and still can't get ground shipping to show. I've changed the packaging method, I've turned off Residential Delivery (set to no), I've added home delivery. Nothing works.If there are any other suggestions, I'd sure appreciate the help. Currently using Magento CE 1.9.4


texts: How to remove trailing slash from Magento 2 url

texts:
I have installed ssl in my Magento 2 store and configured base url to the https version.

But when accessing http version, Magento redirecting url with appending trailing slash.

For example:

My domain is example.com

Base url saved in configuration is https://www.example.com

When I accessing http version http://www.example.com/contactus.html

it is redirecting to https://www.example.com/contactus.html/

Could you please help to remove the trailing slash while redirecting.


texts:
How can I tell if the patch SUPEE-10570 v2 was installed on my magento store?

What are the differences between the v1 and v2 of the patch and how can I tell which version I have installed?

Note: I am aware about the applied.patches.list file, however, I don't trust it 100% and would rather check the files instead.


texts:
$this->_collection->addAttributeToSort('created_at', 'DESC'); // not working
$this->_collection->setOrder('created_at', 'DESC'); // not working
//$this->_collection->setOrder('position', 'DESC');// this is working

I'm using class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar
Any idea how can I do similarly?


texts: Some categories meta title & description is not setting.I am getting backlog in index status. any idea to fix this issue?


texts:
I want to delete the coupon code programmatically. My code is:

$cart = $this->quoteRepository->getActive($cartId);

  if(isset($response_json['errorMessage']) || $json_response['status']['statusCode'] == 0){
    $cart->setCouponCode('');
    $cart->collectTotals()->save();
    $this->logger->debug("test");
  }

I see the "test" in my debug. But the Coupon code not removed. Can someone help me?

Thank you in advance!


texts: Documented way of removing prototypeJS with Jquery and fix the ajax search and 1 page checkout?

texts:
Searched everywhere,

My question is basically if someone knows if its possible to
remove prototypeJS with Jquery and fix the ajax search and 1 page checkout?

I believe also product search and add products depend on prototype.

Im using Magento 1.9CE
The problem is there seems to be nowhere documented how to replace the 1-page checkout from prototype to Jquery.

I have currently the Prototype removed so now the theme is broken, looking desperatly for a solution to replace the prototype js with jquery to make it work again.


texts:
I want to put a button after fieldset legend as shown in fig.

I have tried the code below to achieve this but that not works.

how can I do this..?

$fieldset = $form->addFieldset('custom_fieldset', array(
                                   'legend'=>Mage::helper('cms')->__('Custom Block'),
                                   'after_element_html' => '<button type="button" onclick="alert(\'click me!!\')">click</button>',
                                   ));


texts:
I want to create Magento Range Validation using Range validator.

I want to give range like ( 0 (free)  or >= € 0,99).

Please Any body help me to figure out this problem.

Thanks a lot in advance.


texts: Mage_Page_Block_Html_Toplinks @deprecated after 1.4.0.1, CE 1.8

texts:
I saw on RELEASE_NOTES.txt on CE 1.8:

  Fixed #17451: Header Links (top.links.phtml) does not output
  correctly because it is using the model code (the Toplinks block is
  deprecated)

However, the $this->getChildHtml('topLinks') call on the demo frontend template seems to output links which addLink method of Mage_Page_Block_Html_Toplinks created: shopping cart, login etc.

I didn't understand that. What is the supposed way of adding those links ?

Thanks.


texts: How can I observe the "special price" activation? When the special price becomes active

texts:
How can I observe when a Special price becomes enabled?
You set a date from and to, but which observer is launched when special price becomes available and unavailable?


texts:
We are in the process of moving our Magento site to a new hosting platform. After moving all of the files and making some changes to the template XML, the frontend of the site is now working as expected.

However, when logging into the backend, we receive the following error:

Exception #0 (UnexpectedValueException): Package craftyclicks/module-ukpostcodelookup's source key should be specified as {"type": ..., "url": ..., "reference": ...},
{"type":"git","url":"https:\/\/github.com\/craftyclicks\/magento2-ukpostcodelookup.git","reference":null} given.

I have installed the MDVA-532 patch as suggested here, but to no avail. What's strange is that the site in its current form is working on another server running EasyApachePHP4. Can anyone suggest a fix?

For reference, here's a copy of the relevant area from our composer.lock file:

{
    "name": "craftyclicks/module-ukpostcodelookup",
    "version": "1.0.11",
    "source": {
        "type": "git",
        "url": "https://github.com/craftyclicks/magento2-ukpostcodelookup.git",
        "reference": ""
    },
    "dist": {
        "type": "zip",
        "url": "https://api.github.com/repos/craftyclicks/magento2-ukpostcodelookup/zipball/",
        "reference": "",
        "shasum": "18da5c12868d070721bc3113a8fbf0f32ac21358"
    },
    "require": {
        "php": "~5.5.0 || ~5.6.0 || ^7.0"
    },
    "type": "magento2-module",
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Craftyclicks\\Ukpostcodelookup\\": ""
        }
    },
    "license": [
        "MIT"
    ],
    "authors": [
        {
            "name": "Gabor Peter Suranyi",
            "homepage": "https://craftyclicks.co.uk/",
            "role": "Developer"
        },
        {
            "name": "Gregory Toth",
            "homepage": "https://craftyclicks.co.uk/",
            "role": "Developer"
        }
    ],
    "description": "Apply postcode lookup to Magento 2."
},


texts: Minimum quantity and increase with minimum quantity

texts:
I would like to have a product with a minimum quantity of 25 and if someone wants to order more and press on the arrow for more it needs to jump to 50, 75 etc.

My product is only available per 25. Is it also possible to update the price per click?

If anythings is unclear, feel free to ask for info!


texts: Magento 1.9.4 Grouped product with dropdown menu

texts:
I found browsing the net a piece of code to allow groupable products instead of the table that showed by default to select quantities, have a dropdown menu to select an associate product.
I have in a grouped product, two associates, one simple and one virtual, if I choose the simple product via dropdown menu it goes fine, but if I choose the virtual one I get an error that tells me to indicate the quantity of the product.
It already states 1 in quantity, anyone could help me to fix the code?

Thanks a lot

The file path is: app/design/frontend/rwd/default/template/catalog/product/view/type/grouped.phtml

?>
<?php $this->setPreconfiguredValue(); ?>
<?php $_product = $this->getProduct(); ?>
<?php $_associatedProducts = $this->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?>
<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" class="add-to-cart" id="product_addtocart_form_<?php echo $_product->getId()?>"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

    <?php if($_product->isGrouped()): ?>
        <?php $_subAssociatedProducts = $_product->getTypeInstance(true)->getAssociatedProducts($_product); ?>
        <?php if(count($_subAssociatedProducts)){?>

            <select id="grouped_products" name="grouped_products" onchange="addSuperQty('<?php echo $_product->getId()?>',this.value);">
                <?php foreach ($_subAssociatedProducts as $_item) {?>
                <option value="<?php echo $_item->getId()?>" id="<?php echo number_format($_item->getFinalPrice(),2); ?>"><?php echo $this->htmlEscape($_item->getName())?></option>
                <?php } ?>
            </select>
        <?php }?>
        <span id="span_<?php echo $_product->getId()?>">
        <input type="text" size="3" name="qty" onchange="changeQty(this.value,'<?php echo $_product->getId()?>');" id="<?php echo $_product->getId()?>_qty" maxlength="12" value="<?php echo $_item->getQty() * 1 ?>" class="input-text qty" />
    <?php else:?>
        <input type="text" size="3" name="qty" id="qty" maxlength="12" value="<?php echo $_item->getQty() * 1 ?>" class="input-text qty" />
    <?php endif; ?>

</form>


texts: Invalid amount for capture using Authorize.net and Magento

texts:
We are having an issue where the customer receives payment transaction error with the reason of "Invalid amount for capture" in Authorize.net payment gateway in Magento.

Some customers have been persistent and their order finally goes through after attempting to place the order several times, but we are also losing sales. It appears that if the customer logs off and logs back in it allows them to place the order but not entirely sure of this as it has only been attempted with several customers. This problem started when we moved servers. I have attached a one sample emails of the failure reminder.

Reason Invalid amount for capture.

Checkout Type : onepage

Customer: XXXXXXXX

Total: USD 36.27

Billing Address: XXXXXX

Shipping Address: XXXXXXX

Shipping Method: free US shipping over $75 // USPS Priority Mail

Payment Method: Credit Card

Date & Time: Oct 5, 2014 7:39:22 PM


texts: How do "imports" work in a ui-component?

texts:
I've seen this customizeNameListeners method in the product add/edit form modifier.

Inside it, there is an array that contains a member called imports

    'imports' => [
                'handleNameChanges' => '${$.provider}:data.product.name',
                'handleDescriptionChanges' => '${$.provider}:data.product.description',
                'handleSkuChanges' => '${$.provider}:data.product.sku',
                'handleColorChanges' => '${$.provider}:data.product.color',
                'handleCountryChanges' => '${$.provider}:data.product.country_of_manufacture',
                'handleGenderChanges' => '${$.provider}:data.product.gender',
                'handleMaterialChanges' => '${$.provider}:data.product.material',
                'handleShortDescriptionChanges' => '${$.provider}:data.product.short_description',
                'handleSizeChanges' => '${$.provider}:data.product.size'
            ],

I understand that its purpose is to modify on the fly field values depending on other field values. For example, when adding a product, the SKU is filled in automatically from the product name value.
I also understand that this

'handleNameChanges' => '${$.provider}:data.product.name',

means that the function handleNameChanges from the import-handled.js is called and receives the parameter '${$.provider}:data.product.name'.

What I don't understand is how is this all bound together and how ${$.provider}:data.product.name is parsed.
How/where is the change event (or onkeyup or anything else) is bound to the name field?


texts:
I am trying to upload all my products but I keep getting errors.

I have them with special Characters, When I check the data it is valid and good.

With the next one I get this error:

Please let me know what to do, I made all the categories so I dont get the problem.


texts: Display uploaded image from my extension

texts: I did upload of image according to https://wiki.magento.com/display/m1wiki/How+to+create+an+image+or+video+uploader+for+the+Magento+Admin+Panel everything works just do not know how to display in frontend and backend


texts: How to resize product image of grid page in Magento 2?

texts: I beginner to magento2 and list view image is looks fine but not in grid view so i want to resize grid view product image only. please suggest me.


texts: Authentication method unknown to the client in Magento 2.2.2

texts:
Current php version 7.0.25 with which mysql version compatibility

issue:

3 exception(s):
Exception #0 (Zend_Db_Adapter_Exception): SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
Exception #1 (PDOException): SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
Exception #2 (PDOException): PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password]


texts:
I am using Magento 1.7.

In 1column.phtml under app/design/frontend/default/custom_theme/template/page, which is the page template I'm using, I find the following code:

<?php echo $this->getChildHtml('content') ?>

which is responsible for adding the content to my page.

However, I would like to add some more content to my page, so that it is displayed when this line of code is executed. But I don't know how I should proceed. I read about the layout and blocks system, but still I am not able to add some content to my page.

I know that I can add content to header.phtml or footer.phtml under design/frontend/default/custom_theme/template/page which is then displayed in the frontend. However, in the case of what is inserted by <?php echo $this->getChildHtml('content') ?>, I don't know how to proceed. Could anyone explain me which steps I need to follow in order to add some additional content?

I am pretty new to Magento, so if you think there is some lack of info in my question, please tell me and I will provide it.


texts: Magento admin dashboard showing after login

texts:
My admin dashboard after logging in is showing the following error:

does any one know the reason behind it
or how can we solve it?
I have recently installed this module through composer
I have recently Installed this module through composer
https://marketplace.magento.com/klarna-m2-checkout.html


texts: How to Add +1 day if shipout day is Sunday?

texts:
How to add +1 if the shipout from or to day is SUNDAY?

Postage: FREE (UK MAINLAND)

As of current Script the Output will be Estimated Delivery: 25th March (Sat) - 26th March (Sun) If today is 21st March Tuesday.

I need the output like Estimated Delivery: 25th March (Sat) - 27th March (Mon) If today is 21st March Tuesday.

Also

As of current Script the Output will be Estimated Delivery: 26th March (Sun) - 27th March (Mon) If today is 22nd March Wednesday.

I need the output like Estimated Delivery: 27th March (Mon) - 28th March (Tue) If today is 22nd March Wednesday.


texts: magento 2 Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string

texts:
In custom theme And category page show this error-

Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string, null given, called in /var/www/html/.....

1 product is added that's why in image show "1 items".

Run all commands upgrade,indexing,caching,deploy,rename var folder still getting this error


texts: How to add PHP to a CMS page in Magento 2?

texts:
Via Admin > Content > Pages I made a page that I will be using as the homepage. I want to add some PHP to this page, however this does not work (directly).

How can I do this?

I remember using a .phtml for this in Magento 1, but I can't remember how I did this, and things may well be changed since Magento 2.


texts: Magento : Multiple Configurable Swatches on Product Listing Page

texts:
I want to show multiple configurable swatches on product listing page.

For that I created configurable_category.phtml where I replicated configurable.phtml file to showing the configurable swatches like this:

$_product    = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
$_jsonConfig = $this->getJsonConfig();
$_renderers  = $this->getChild('attr_renderers')->getSortedChildren();

....

$_rendered = false;
foreach ($_renderers as $_rendererName):
   $_renderer = $this->getChild('attr_renderers')->getChild($_rendererName);
   if (method_exists($_renderer, 'shouldRender') && $_renderer->shouldRender($_attribute, $_jsonConfig)):
       $_renderer->setProduct($_product);
       $_renderer->setAttributeObj($_attribute);
       echo $_renderer->toHtml();
       $_rendered = true;
       break;
   endif;
endforeach;

....

Now I have to include this code:

<block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />

But I don't know where to include it. I've tried to put it in catalog.xml under the catalog_category_default and catalog_category_layered but $_renderers  = $this->getChild('attr_renderers')->getSortedChildren(); still returns false.

Can anyone help me with that? Or anyone have any idea?


texts: (Solved) How to reach "add to cart" button and price inside Recently Viewed Products Widget in magento 2

texts:
I need to make some custom changes on add to cart button and item prices, in Recently Viewed Products widget.
For add to cart button, i need some custom php statement,
And for prices i need old price to be displayed on discounted products
I tried to make some edits on:

vendor\magento\module-catalog\view\frontend\templates\product\widget\viewed\sidebar.phtml

vendor\magento\module-catalog\view\frontend\ui_component\widget_recently_viewed.xml

vendor\magento\module-catalog\view\frontend\templates\product\list.phtml

and few more ...
But when i made some changes, nothing seems to appear on page.
Does anyone know where i can edit these elements, so the changes will be applicable for this widget only.
Thanks
[EDIT, WORKING SOLUTION]
I have found the files where i can:
edit button:

vendor\magento\module-catalog\view\frontend\web\template\product\addtocart-button.html
extended to ->

app\design\frontend\Vendor\theme\Magento_Catalog\web\template\product\addtocart-button.html

edit item elements srtucture:

vendor\magento\modulecatalog\view\base\web\template\product\list\listing.html
extended to ->

app\design\frontend\Vendor\theme\Magento_Catalog\web\template\product\list\listing.html

add some javascript:

vendor\magento\module-catalog\view\frontend\templates\product\widget\viewed\sidebar.phtml
extended to ->

app\design\frontend\Vendor\theme\Magento_Catalog\templates\product\widget\viewed\sidebar.phtml


texts: Remove index.php from www.domain.com/abc/index.php/xyz

texts:
What's happening:

domain.com/abc/index.php/xyz gets redirected to www.domain.com/abc/index.php/xyz

I'd like:

domain.com/abc/index.php/xyz gets redirected to www.domain.com/abc/xyz

In the document root directory of a Magento installation, I have the following to redirect domain.com/... to www.domain.com/..., and index.php is never there.

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [NE,R=301,L]

However, there's a sub-directory that contains static pages at root/abc. This directory has its own .htaccess file, and I've put the same rewrite condition and rule as above. It also have the following. I'm not sure what the first two conditions are doing. The RewriteRule seems like it should remove the index.php.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /corps/index.php/$1 [L]

Any ideas?


texts: Block is not calling properly in magento 2 custom module

texts:
I have a custom theme in magento 2 website.

In home page i called a banner slider(Banner_slider is a custom module)

I called the slider like this in home_content.phtml(design/frontend/company/projectname/Magento_theme/templates/home-content.phtml) like this

<?php include ($block->getTemplateFile('Company_Bannermanager::bannermanager.phtml')) ?>

location of bannermanager.phtml is - (app\code\Company\Bannermanager\view\frontend\templates)

In this file i called the block method(getHomepageBanners()) like this

<?php $home_banners =  $block->getHomepageBanners(); ?>

Block file location is -( app\code\Company\Bannermanager\Block\Index )

I am getting this error

  Error filtering template: Warning: Invalid argument supplied for foreach() in D:\xampp\htdocs\mollys_spirits\app\code\Company\Bannermanager\view\frontend\templates\bannermanager.phtml on line 17

I know i can call this block like below

<?php
$blockObj= $block->getLayout()->createBlock('Company\Bannermanager\Block\Index\Index');
$home_banners =  $blockObj->getHomepageBanners(); ?>

What part i am missing in first method.

Update

My layout file is homebanner_index_index.xml-(app\code\Eight25media\Bannermanager\view\frontend\layout)

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <title>Banners</title>
</head>
<body>
    <referenceContainer name="content">
        <block class="Company\Bannermanager\Block\Index\Index" name="homebanner"  template="Company_Bannermanager::bannermanager.phtml"/>
    </referenceContainer>
</body>


texts: Magento 2 After Migration Configurable Product Price blank

texts:
I have Migrated Magento 1.9.1.0 website in Magento 2.2.4,all data is migrated successfully.

I have an issue when checking products in admin->catalog->product and compared price with Magento 1 ,configurable products have blank price and not editable

while in Magento 1 its price is 79.95 and special price is 57.98.Variants products price are same as in Magento 1 ,please check below image

but clicking on advanced pricing,its display blank

my issue is same as below referenced but solution is not here.

https://github.com/magento/data-migration-tool/issues/281

I don't have idea how to resolve that issue.Special price are not display as well as config product price are displaying wrong in front-end.

Please help me if anyone have same problem.


texts: M2.2: On the admin side, when an admin modifies the price, how to get warning message what if he set price below $100

texts:
When an admin is about to modify the price and save the modification, he should get warning message which he should set a price over $100 and it must not be saved what if he set the price below $100.

Is there any basic function on Magento? Or i can use Observer in admin page.

Please give me an idea for this.

Thank you


texts: Magento 2 : Custom model with EAV attributes. PUT is not working

texts:
I'm trying to figure out how works EAV attributes. So I made a simple example with API rest. Everything is working except when I call PUT function:

{
    "sample" : {
        "id": 22,
        "name": "Sample 22"
    }
}

{
"message": "Could not save sample: %1",
"parameters": [
    "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (`entity_id`=22)' at line 1, query was: UPDATE `sample_entity` SET  WHERE (`entity_id`=22)"
],
"trace": "..."

}

It's like it can't figure out how to update the attribute name, but when I call a POST for creating a new Sample it creates it right.

I did it that example based on these other example repositories:

https://github.com/ksz2013/m2-foggyline-office
https://github.com/dmatthew/magento2-module-brand

The model is that simple:

id (sample_entity)
name (sample_entity_varchar)

Posting some code (request something if you need it) I have no idea what I missed neither where it can be:

etc/webapi.xml

<route url="/V1/gsp/sample" method="POST">
    <service class="Gsp\Test\Api\SampleRepositoryInterface" method="save"/>
    <resources>
        <resource ref="Magento_Backend::admin"/>
    </resources>
</route>

<route url="/V1/gsp/sample" method="PUT">
    <service class="Gsp\Test\Api\SampleRepositoryInterface" method="save"/>
    <resources>
        <resource ref="Magento_Backend::admin"/>
    </resources>
</route>

Model/SampleRepository.php

public function save(\Gsp\Test\Api\Data\SampleInterface $sample)
{
    try {
        $this->resourceModel->save($sample);
    } catch (\Exception $e) {
        throw new \Magento\Framework\Exception\CouldNotSaveException(
            __(
                'Could not save sample: %1',
                $e->getMessage()
            ),
            $e
        );
    }
    unset($this->instances[$sample->getId()]);
    return $sample;
}

Api/Data/SampleInterface.php

<?php

namespace Gsp\Test\Api\Data;

/**
 * @api
 */
interface SampleInterface extends \Magento\Framework\Api\CustomAttributesDataInterface
{
    /**#@+
     * Constants defined for keys of  data array
     */
    const ID = 'id';
    const NAME = 'name';
    /**#@-*/

    /**
     * @return int|null
     */
    public function getId();

    /**
     * @param int $id
     * @return $this
     */
    public function setId($id);

    /**
     * Get category name
     *
     * @return string
     */
    public function getName();

    /**
     * Set category name
     *
     * @param string $name
     * @return $this
     */
    public function setName($name);
}


texts: Magento Sending Transactional Emails To Previous Customers

texts:
I have a very strange issue happening at the moment on one of my Magento sites (CE 1.9.1.0).

When an order is placed the transactional email is being sent to the customer correctly BUT is also being sent to the previous customers. The number of recipients of the email is growing with each sale (as in from a certain point every customer from that point is being added to the email recipients).

Can't find any info about this issue anywhere.


texts: Creating categories that are dynamically driven by filters

texts:
I’m working on an automotive parts based site and I’m trying to determine the best way to achieve the following.  Every part we have is specific to make/model.  What I want to do is create a finder that lets you drill down by year, make, model and submodel.  I’ve found an extension from Amasty to do this but the one thing I’m not finding is the ability to dynamically create category URL’s based on these filters.

For example if I have a 2013 Ford Mustang GT I’d like to be able to have a category landing page at http://www.example.com/2013-Ford-Mustang-GT which contains a listing of all relevant parts which is organized by a templated heiarchy.  For example all categories will have a structure that includes categories such as Suspension, Aero, Exhaust, etc.

Any suggestions on how to best tackle this?


texts: when Template file is called from another Template file product details are unable to show: In Magento 2

texts:
When I am Trying to call Custom Template file test.phtml on product view page Template file i.e on  wrapper.phtml template file is called but, when I am trying to output product details from my custom  test.phtml I am unable to output,So any help how to get product details  on my Custom test.phtml

File path:

app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/options/wrapper.phtml

<?php include ($block->getTemplateFile('Magento_Catalog::product/view/options/test.phtml')) ?>

My Custom Template File Path:

app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/options/test.phtml

But I was unable to load product details when I write code on test.phtml file

Thanks


texts:
what is the media/js folder in Magento 1.9?
In the w3c validator, it is showing error. How to resolve those errors that are showing in the w3c validator.

Please help


texts: Mass update ASCII bullets in imported product descriptions to HTML/CSS list items

texts:
I've imported a large catalog of products that contain ASCII bullets. I need to convert them to style friendly HTML/CSS ordered lists and list items. Here is an example of how the specific segment of product descriptions are currently stored:

Features include:
•        USB interface
•        USB cable included
•        Power supply included
•        All-in-one-box convenience
•        Energy Star qualified
•        Average lifespan 360,000 hours / 60 million lines
•        Autocutter life of 1.5 million cuts

I've considered using jQuery to "style" those bullet instances to allow an opening <ul> tag then iterate through the <li> tags. I think ultimately updating with a "find and replace" MySQL query (e.g. http://www.magetricks.com/tricks/find-and-replace-a-string-with-mysql-query-or-how-to-automate-base-url-change). I might just have to get granular and replace

Features include:

with

Features include:<ul>

Anyone faced a similar issue? Is there a better way to address "normalizing" data like this after import?


texts:
This File responsible for setting Grand Total in Order Grid. I test it.

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Sales\Ui\Component\Listing\Column;

use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;
use Magento\Framework\Pricing\PriceCurrencyInterface;

/**
 * Class Price
 */
class Price extends Column
{
    /**
     * @var PriceCurrencyInterface
     */
    protected $priceFormatter;

    /**
     * Constructor
     *
     * @param ContextInterface $context
     * @param UiComponentFactory $uiComponentFactory
     * @param PriceCurrencyInterface $priceFormatter
     * @param array $components
     * @param array $data
     */
    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        PriceCurrencyInterface $priceFormatter,
        array $components = [],
        array $data = []
    ) {
        $this->priceFormatter = $priceFormatter;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

    /**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
                $currencyCode = isset($item['base_currency_code']) ? $item['base_currency_code'] : null;
                $item[$this->getData('name')] = $this->priceFormatter->format(
                    $item[$this->getData('name')],
                    false,
                    null,
                    null,
                    $currencyCode
                );
            }
        }

        return $dataSource;
    }
}

$item array return all orders i print one order print_r($item) die('');

  Array ( [id_field_name] => entity_id [entity_id] => 53 [status] => pending [store_id] => Main Website
         Main Website Store
            Default Store View
      [store_name] => Main Website Main Website Store [customer_id] => 1 [base_grand_total] => 2623.9800 [base_total_paid] => [grand_total] => 2623.9800 [total_paid] => [increment_id] => 000000130 [base_currency_code] => USD [order_currency_code] => USD [shipping_name] => Veronica Costello [billing_name] => Veronica Costello [created_at] => 2019-02-25 19:46:38 [updated_at] => 2019-02-25 14:46:38 [billing_address] => 6146 Honey Bluff Parkway Calder Michigan 49628-7978 [shipping_address] => 6146 Honey Bluff Parkway Calder Michigan 49628-7978 [shipping_information] => Best Way - Table Rate [customer_email] => roni_cost@example.com [customer_group] => 1 [subtotal] => 3030.0000 [shipping_and_handling] => 0.0000 [customer_name] => Veronica Costello [payment_method] => checkmo [total_refunded] =>

I want to get order Items from sales_order_item table when I give a specific id like => $item['entity_id'] then it return all the order items of specific id $item['entity_id'].

How can do this? kindly guide me little bit.


texts: how come this override doesnt work magento 2

texts:
var config = {
    "map": {
        "*": {
            "Magento_Checkout/js/model/shipping-save-processor/default": "module_name/js/shipping-save-processor/default-override"
        }
    }
};

var config = {
    config:
    {
        mixins:
        {
            'Magento_Checkout/js/model/shipping-save-processor/default':
                { 'module_name/js/shipping-save-processor/default-override': true }
        }
    }
};


texts: How to get custom image attribute into header

texts:
I have created an attribute for image as "custom_image" to show it in the in the header for every product.

I have get the base_image with the following code:

<?php $_product = Mage::registry('current_product')->getId();
$product = Mage::getModel('catalog/product')->load($_product);
$product_image = $product->getImageUrl();

Now i want to get the custom_image and i have tried it like:

 $product_image = $product->getImageUrl(custom_image);

but it is not working kindly guide me what wrong i am doing and how i can get the custom image attribute.

thanks!


texts:
What order do the deployment tasks of static-files, DI compilation, and setup:upgrade have to be performed?

In order to deploy updates for a Magento 2 site to live, the common approach would be to pull in the latest code and perform build actions on a release candidate (RC) of the repo to that running on live. If all builds OK then the files can be copied very quickly using rsync to be live.

The order I'm trying to use is:

Update code in RC
Clear var and pub/static in RC
Deploy static files in RC
Compile DI in RC
Rsync code from RC to the live site
Perform setup:upgrade in maintenance mode on live

Such an approach is complicated by my lack of knowledge of what each step is precisely relying on.

Obviously static deployment and compiling DI is ridiculously slow and so should be performed before copying across files, but after running setup:upgrade there is a message saying "Please re-run Magento compile command" suggesting that something has now changed which compilation requires.

Can the above order be safely used?


texts:
I have a little problem to call a function from my block to my controller. I need to get a function from my block locate in Mymodule/AdminPage/Block/Adminhtml/Contactslist.php help pls i did it before once but I fail in every attempt i make.

<?php
  namespace Mymodule\AdminPage\Controller\Adminhtml\AdminDescsdev;

  class Index extends \Magento\Backend\App\Action
  {
    protected $resultPageFactory;

    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
         parent::__construct($context);
         $this->resultPageFactory = $resultPageFactory;
    }

    public function ajaxProcessGetDescReplaces()
    {
        die(jsonEncode(array(
            'descReplaces' => " function to call getAll() "
        )));
    }

    public function execute()
    {
        return  $resultPage = $this->resultPageFactory->create();
    }
  }

here is my block :

<?php
namespace Mymodule\AdminPage\Block\Adminhtml;

use Magento\Backend\Block\Template;

class Contactslist extends \Magento\Backend\Block\Template
{

 public function __construct(
     \Magento\Backend\Block\Template\Context $context,
     \Mymodule\AdminPage\Model\ContactFactory $contactFactory,
     \Magento\Framework\View\Result\PageFactory $resultPageFactory,
     array $data = []
 ) {
      parent::__construct($context, $data);
      $this->contactFactory = $contactFactory;
      $this->resultPageFactory = $resultPageFactory;
 }

    public function getAll(){
    $data = array();
    $model = $this->contactFactory->create();
    $newData = $model->getCollection();
    $tabl = array();
    foreach ($newdata as $d )  {
        $tabl[] = array(
            'toreplace' => $d->getToreplace(),
            'replaceby' => $d->getReplaceby()
        );
    }
    return $tabl;
}
}


texts:
How can I add top-header above main menu?

I need top-header with text above main menu


texts: Having problem to add new column in admin >sales > order grid ,product name is repeating

texts:
I am try to add columns in Admin > sales >order by overriding method.

Copied

app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

to

app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php

& using Renderer, created Renderer at

app/code/local/Mage/Adminhtml/Block/Sales/Order/Renderer/Productsname.php

but getting some product repeating like in the image
I add following code in Grid.php to protected function _prepareColumns()

$this->addColumn('name', array(
        'header' => Mage::helper('sales')->__('NAME'),
        'index' => 'productname',
        'type' => 'text',
        'renderer' => 'Mage_Adminhtml_Block_Sales_Order_Renderer_Productsname',
    ));

& following code in Productsname.php

    <?php
class Mage_Adminhtml_Block_Sales_Order_Renderer_Productsname extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    public function render(Varien_Object $row)
    {
        $order=Mage::getModel('sales/order')->load($row->getData('entity_id'));
        $str="";

        foreach($order->getAllItems() as $_item){
            $str .= $_item->getname()."<br>";
    }
        unset($order);
        return $str;
    }
}
?>


texts:
I'm using this extension https://github.com/Sebwite/magento2-category-sidebar/
I have installed it but I'm struck at a configuration point
It says
You should implement the block Sebwite\Sidebar\Block\Sidebar in your theme to make this extension work. Example
But have no idea where to write it.
Anybody kindly help I'm using magento v2 .
I'm having this file structure


texts: How to filter custom comma separated sales order attribute in sales order grid?

texts: I created a custom attribute that saves comma separated values in it for orders. Now I want to display them in the sales_order_grid and be able to filter for each value. How can I implement a custom conditional filter logic for a column in the sales order grid?


texts: Magento2: custom template for custom product type

texts:
I'm having different type of products on my website with different layouts. So I've created a custom product type but don't know how to set a custom template for my custom product type. So when someone browse the product they will see different product layout and not the default one.

Thanks in advance!


texts: How to add custom validation on checkout page before shipping method rendering in magento 2

texts:
How to add custom validation on checkout page before shipping method rendering and if validation success then only show shipping methods or else show error message.

I have already implemented this but using preference shipping.php overriding the issue is that it is calling for each shipping method (degrading module efficiency and message is showing on other page not on same checkout page)

Here is my git repo on dev branch

https://github.com/gauravnewton/Excellence_UkOnly/tree/dev

also i am applying some validation on product attributes and shipping address's country code

see in my model/shipping/shipping.php file


texts: Upgrade magento2 to latest version via composer

texts:
I installed Magento2 via composer, following this guide.

Now I see version 2.1.6 is available and I'd like to upgrade. Please confirm if these commands will do the trick or what I'm missing in case they're wrong.

Note this site is in production mode

./composer.phar self-update
./composer.phar update
bin/magento cache:flush
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
bin/magento setup:di:compile
bin/magento setup:static-content:deploy


texts:
I have created a custom attribute 'manufacturer' with options like 'Fossil, Tommy Hilfiger, etc'. Now I just need listing for each brand.

For example "https://magento.store.com/fossil.phtml" should return all products under the 'Fossil' manufacturer and likewise. Is there any way to accomplish this.

Thank you in advance.


texts: V1/customers/me rest endpoint returning same response for each request

texts:
I am working on magento2.2.6, Rest api endpoing V1/customers/me returning a single response for each token.
I have generated tokens for different users, but it always return the same response, even any wrong token is also passed then the result is same, it seems like it has cached the response.
I run the following commands to reconfigure and clear cache:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
** rm -rf var/cache/* && rm -rf var/view_preprocessed/* && rm -rf var/page_cache/* && rm -rf var/composer_home/* && rm -rf pub/static/* && php bin/magento setup:static-content:deploy -f && php bin/magento cache:flush && php bin/magento cache:clean **

But no gains.
There are 2 stores in this magento setup and it has stuck with two customers data on each request for any customer token, either it is correct or wrong.
Please guide me, How can I fix this?
Thanks!


texts: adding a tracking pixel in order confirmation page

texts:
I have received a tracking pixel from one of our advertising company, and they asked me to place that code in my order confirmation page.

first of all can some one tell me where is the order confirmation file located in magento?

And 2nd if i need to get "order ID" value and "Amount" of the order then what to use in this pixel.

<img src="https://www.emjcd.com/u?AMOUNT=AMOUNT&CID=7777777&OID=OID&TYPE=5555555&CURRENCY=GBP&METHOD=IMG" height="1" width="20"/>

you can get more information here: http://www.pricerunner.co.uk/about/sales-tracking-instructions.html


texts:
How can I dynamically set selected option for a multi-select box
my formelement below
<fieldset name="websites" class="Magento\Store\Ui\Component\Form\Fieldset\Websites" sortOrder="30">
    <settings>
        <required>true</required>
        <collapsible>true</collapsible>
        Tag in Websites
    </settings>
    <field name="storeviews" formElement="multiselect">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">tag</item>
                <item name="default" xsi:type="number">0</item>
            </item>
        </argument>
        <settings>
            <validation>
                <rule name="required-entry" xsi:type="boolean">true</rule>
            </validation>
            <dataType>int</dataType>
            Website
            <dataScope>website_id</dataScope>
        </settings>
        <formElements>
            <multiselect>
                <settings>
                    <options class="Lof\ProductTags\Ui\Component\Listing\Column\Tag\Options"/>
                </settings>
            </multiselect>
        </formElements>
    </field>
</fieldset>


texts: Show Sold Out Products for One Category Only

texts: In Magento 2, is there a way to display sold out products for one category, while continuing to hide them for all others? Or can anyone think of a solution?


texts: Magento 2 Add Custom fields to Bundle Product add options

texts:
want to do this

I have followed similar (Magento 2 add new custom option text field) topic but it's about custom options for simple products. Somebody in commets say's that he achieved this for bundle following this link. But It didn't work for me.

Here I what i have:

di.xml file in my module

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<plugin name="bachus_bundlecontextpros_custom_option" type="Bachus\BundleContextPros\Plugin\Bundle\Ui\DataProvider\Product\Form\Modifier\BundleCustomOptions" sortOrder="1"/>
</type>
</config>

and my BundleCustomOptions class

namespace Bachus\BundleContextPros\Plugin\Bundle\Ui\DataProvider\Product\Form\Modifier;

class BundleCustomOptions
{

public function afterModifyMeta(
    \Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundleCustomOptions $subject,
    $meta
    ) {
        $meta['custom_options']['children']['options']['children']['record']['children']['container_option']['children']['container_common']['children']['custom_text'] =
        $this->getTitleFieldConfig(
            200,
            [
                'arguments' => [
                    'data' => [
                        'config' => [
                            'label' => __('Custom Text'),
                            'component' => 'Magento_Catalog/component/static-type-input',
                            'valueUpdate' => 'input',
                            'imports' => [
                                'optionId' => '${ $.provider }:${ $.parentScope }.option_id'
                            ]
                        ],
                    ],
                ],
            ]
            );
        return $meta;
}

/**
 * Get config for "Title" fields
 *
 * @param int $sortOrder
 * @param array $options
 * @return array
 */
protected function getTitleFieldConfig($sortOrder, array $options = [])
{
    return array_replace_recursive(
        [
            'arguments' => [
                'data' => [
                    'config' => [
                        'label' => __('Custom Text'),
                        'componentType' => \Magento\Ui\Component\Form\Field::NAME,
                        'formElement' => \Magento\Ui\Component\Form\Element\Input::NAME,
                        'dataScope' => 'custom_text',
                        'dataType' => \Magento\Ui\Component\Form\Element\DataType\Text::NAME,
                        'sortOrder' => $sortOrder,
                        'validation' => [
                            'required-entry' => false
                        ],
                    ],
                ],
            ],
        ],
        $options
        );
}

}

Update: Now I am able to view the custom field in bunlde options by modyfing Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel.php

adding just after requierd

'bundle_template' => [
               'arguments' => [
                'data' => [
                    'config' => [
                        'dataType' => Form\Element\DataType\Text::NAME,
                        'formElement' => Form\Element\Input::NAME,
                        'componentType' => Form\Field::NAME,
                        'description' => __('bundle template'),
                        'dataScope' => 'bundle_template',
                        'label' => 'bundle template',
                        'sortOrder' => 40,
                    ],
                ],
            ],
        ],

UPDATE I am able to save the value in data base but not see in admin

I just simply crated colum with exact name that my new custom field has in table catalog_product_bundle_option but it didn't work.

I would appreciate any help.
Thanks


texts: Magento 2 how to get custom attribute value in cart page and mini cart

texts: Magento 2 how to get custom  attribute value in cart page and weight in mini cart.


texts: Magento 2.3 custom font not loaded in email

texts:
We want to use the 'Open Sans' font of Google in our transactional email templates.

But when we sent the email it does not load the custom font inside the email.
We changed the file /app/code/design/frontend/theme/theme/web/css/email-fonts.css to the code below.

I also saw that The Magento Blank theme uses the Open Sans font. But for some strange reason, it is not added by default. I also can not find the font files that should be loaded in this file; https://github.com/magento/magento2/blob/2.3/app/design/frontend/Magento/blank/web/css/source/_typography.less There is not opensans font folder.

But still it is not loaded inside the email. What are we missing?

/* latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Open Sans Bold'), local('OpenSans-Bold'), url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN7rgOUuhpKKSTjw.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


texts: Multi select options for Magento2 custom Attribute

texts:
I have created one custom attribute for Category with Multi select option.I am trying to get dynamic values from source file but first value only printing in multi select please give solution and check my code what i did wrong.
`

    $school_model = $this->_modelCreateFactory->create();
    $data = $school_model->getCollection()->getData();
    $value1 = array();
    foreach ($data as $key => $value) {
          if(!empty($value['school_id']))
          {
            if ($this->_options === null) {
                $value1[$key]['school_id'] =  $value['school_id'];
                $value1[$key]['school_name'] = $value['school_name'];

                $this->_options =[  [
                                       'value' => $value1[$key]['school_id'],
                                       'label' => __($value1[$key]['school_name'])
                                    ]
                                 ];
            }
          }
        }

    return $this->_options;
}`


texts:
I'm working on a really simple gift finder at the moment. So far I only have a gift finder category that is  filtering products by price range, but i would like to add some more choices as well - age, gender and maybe occasion seems fitting for a start.

I suppose the best way to do this would be to add the choices as attributes to the products, and use an extension that adds the possibility of choosing multiple filters at the same time.

However, this gives me 2 problems. The attributes are totally irrelevant for all other categories. Can I make them used only for this gift finder category?

Also - i need to add attributes to some 2000 products. Is there any way i can select multiple products and give them all the same attribute?

If theres a better solution to this, please let me know.


texts: How to Install PWA Studio for Live Server

texts:
I have and AWS instance running Magento 2.3.5 with sample data and installed PWA Studio by following directions here:
https://magento.github.io/pwa-studio/tutorials/pwa-studio-fundamentals/project-setup/
Node and Yarn is installed and all working and everything gets installed following those directions.
But, I cannot find any directions on how to use this on a live server.  After following the above instructions all I get is this URL:
https://pwa-studio-plo4s.local.pwadev:8091
And clicking that does not get anything in my browser.
I even tried following the Venia Storefront directions:
https://magento.github.io/pwa-studio/venia-pwa-concept/setup/
But I can't tell if I am supposed to follow those directions instead of the other directions or in addition to those directions.  If I follow them in addition to it just installs it in another PWA directory.
I can't find anything that will tell me how to view this live using my domain name.  All of the setup to view the site/pwa is not clear at all.  Even sites like Nexcess, Webkul and CedCommerce that have PWA articles have been no help and just seem to repeat the same directions.
Can someone offer instructions on how to see this live? There has to be something/someone that has had success and good directions on how to get this implemented and working with a live site.
Thanks,
Stan


texts:
When my customers exports a CSV file of the current orders, the export seems very strange.
Here is a image that shows the layout of the CSV file:
Any ideas what the problem could be?
Thanks in advance!


texts: magento 2 swatches are not displaying on product list page

texts:
In Magento 2.3.2 color swatches are not displaying on product list page.
What am I missing here?


texts: Magento2 Mysql is using full CPU and running the same query over and over again

texts:
We are running into the situation where the Mysql is using full CPU and running the same query over and over again.

    SELECT `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position`, SUM(soi.qty_ordered) AS `ordered_qty`, `order`.`state`, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_entity` AS `e`

 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '4' AND price_index.customer_group_id = 0

 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=8 AND cat_index.category_id='89' AND cat_index.is_parent=1

 LEFT JOIN `sales_order_item` AS `soi` ON soi.product_id = e.entity_id

 INNER JOIN `sales_order` AS `order` ON order.entity_id = soi.order_id

 LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 WHERE (order.state <> 'canceled' and soi.parent_item_id IS NULL AND soi.product_id IS NOT NULL) GROUP BY `soi`.`product_id` ORDER BY `ordered_qty` DESC

 LIMIT 6

can anyone help me. Why this issue is coming.


texts: Magento 2: Adding "updated_at" column does not update current time stamp

texts:
I am using Magento 2.2.6 version. Am just trying to add an extra column updated_at  in setup/upgradeschema.php. But on saving data, it is not updating the timestamp automatically. It is null always. Here is my code,

$installer->getConnection()->addColumn(
                'updated_at',
                \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
                null,
                ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE],
                'Updated At'
            );

Adding the above code in

  setup/InstallSchema.php

or

  in upgradeschema[But only on creating the whole new table]

works fine. Can someone help?


texts: Remove Qty Box from mini cart and the page of checkout page

texts: I have a site to buy a unique product (qty =1) so i need to eliminate Qty from mini cart, i just overrided /web/template/minicart/item/default.html : i removed div Qty but she still there any idea how to override and what to override exactly thanks in advance


texts: UI Component Form Validation: Pattern method

texts:
I've got an admin ui_component form which has a listing of fields and I'm adding validation to them.  One I'd like to use a custom pattern. The form in general works, it's just this "pattern" validation that's causing an issue.

So here is the relevant <field> setup from my module_controller_form.xml file:

    <field name="my_custom_filed">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">My Custom Filed</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">model_name</item>
                <item name="dataScope" xsi:type="string">my_custom_field</item>
                <item name="sortOrder" xsi:type="number">1</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                    <item name="no-whitespace" xsi:type="boolean">true</item>
                    <item name="validate-pattern" xsi:type="string">/^[a-z][a-z0-9_.-]$/i</item>
                </item>
            </item>
        </argument>
    </field>

The above generally works.  I get a javascript error about the string /^[a-z][a-z0-9_.-]$/i not having the method test().  According to validation.js I see the content for the pattern validation method as being:

    "pattern": [
        function (value, element, param) {
            return this.optional(element) || param.test(value);
        },
        'Invalid format.'
    ],

When this code runs, it runs with the following invocation:

validations['pattern']('Test String', [element], "/^[a-z][a-z0-9_.-]$/i")

Sadly, it is passing the value of the <item> node as a string, instead of translating that to a RegExp object.

Is there a way to specify the validation pattern from the *_form.xml and have it properly transform the value to a regular expression object?  I haven't really seen any core modules use this validation within their XML declarations, but it seems like it should still work.

UPDATE

I'm still looking into this, trying to find where the form XML for the validation node is translated into the javascript bindings.  Does anyone know where I can start searching for that?


texts: Is it possible to have such kind of slider in Magento 2?

texts: Please check screen shot. Is such kind of slider is available in Magento 2?


texts:
I have different admins adding products for different categories. One of them has gotten back to me to say they cannot see the image upload control. I would normally advise it is an issue with Flash on the computer, but he is adamant that his Flash is up to date and present.

I will be performing a few more investigations for them, but would there be any other reason why they might not be able to see the control?


texts: Magento: Allowing insecure content on https pages

texts:
I'm facing an issue and I have no idea how to solve it. I use on another websites (which aren't developed in Magento) a jQuery script that gets an address once we type the zip code (a lot websites in Brazil, especially e-commerces, use that) but the url to retrieve all data, using ajax, is a "http" url and Magento blocks any requests made to that url once it doesn't use https.

Is there a way to make Magento allow this kind of http request even not using ssl? The feature of filling the user's address fields automatically is very important to make the user life easier, so, my customer really needs that.

Any ideas?

Thanks everyone!


texts: Magento2: Redis Cache issue on Product page gallery image not showing

texts:
We are facing issue with Magento2 with Redis Cache on Product page gallery image not showing.
Images are showing on Category listing and all pages but on product view page images not showing.
We are using Redis 4.0 ver and using cloudfront with magento2 and we have 2 storeview.
In Arabic default store view image are displaying but in English storeview images are not showing.
In admin product images are assign in all products.
When click on image URL, it's showing pub/media/catalog/product/cache/1851fb9fe6a1abd654a28e505b3e92be/7/0/7006005_test.jpg
image cache folder(1851fb9fe6a1abd654a28e505b3e92be) is showing wrong path on english store view


texts:
I want to display the company name by default inside the contact form.
Just like the customer name and emailaddress.

I tried this, but that does not work.

<?php echo $this->escapeHtml($this->helper('contacts')->getCompany()) ?>

What line should I use?


texts: how to create a CRON job to update products inventory

texts: I want to create a CRON job which updates my Magento products Inventory by matching sku and product name with the third party products inventory. third party is using Sql server and my Magento project is on MySql.


texts: Requested entity doesn\'t exist in Magento 2

texts:
I am trying to get the order information in my custom module from the front store, it is saying Requested entity doesn\'t exist.

But I have an order and order ID: 000000013.

/**
     * @var \Magento\Sales\Api\OrderRepositoryInterface
     */
    protected $orderRepository;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
        array $data = []
    )
    {
        $this->orderRepository = $orderRepository;
        parent::__construct($context, $data);
    }

    public function getOrder($orderId,$email){

        //$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
       // $orderInformation = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);

       try{
           $order = $this->orderRepository->get($orderId);

           if(trim($order->getCustomerEmail()) == trim($email)){
               return $order;
           }else{
               return $order;
           }
       }catch (\Exception $e){
            return $order;
       }

    }

Even though I debugged see below pic.

I tried 2 ways (API and Model Class) but returning the same error.

Any help on this.


texts: How to remove "Help us keep magento healthy" in Magento 2.1

texts:
Can anybody tell me where they moved this?

Changed the footer.phtml in

/html/vendor/magento/module-theme/view/frontend/templates/html

But it is still being shown, so it must be somewhere else.


texts: How to get Search result Product collection outside result.phtml

texts:
I need to get current product collection (actually I just need all Product IDS of products in current search result) of search result page in outside result.phtml, because I'm going to do something on layered navigation according to the product collection of search page can someone help me to get the product collection outside search result page

I have tried with

$term = Mage::helper('catalogsearch')->getQueryText();
    $collection = Mage::getResourceModel('catalogsearch/query_collection')->setQueryFilter($term)->getData();

but can not seems a way to return product IDs from above code.


texts:
I have a Magento store and I want to hide it from cms detectors.
I mean I don't want anyone to know my website CMS and that my website is built on Magento.

There are some websites like http://guess.scritch.org/ which are detecting CMS and I want to hide my website CMS from their observation.

There are some ways to hide WordPress websites CMS but I couldn't find anything for Magento


texts: Magento 1 image upload error for product admin windows only

texts: On a mac I can upload images in the admin area for products without an issue. However, on a windows machine I get an "http image upload error" I've looked in .htaccess. Please help


texts: How to make a custom facebook and google login for magento

texts:
I am trying to make a custom social login for magento how can I go about the integration of facebook and googles login with magento's login system using php etc.
I am unsure of actually how to go about adding a login process to magento?
Thanks


texts: Magento 2 - How to set format datetime for all system

texts:
How to set format datetime for all system ?

Such as: date attributes of entity(product, customer etc), import, export etc

Anyone know, please show me step by step.


texts: Magento2 - How to move Order ID My Account Page?

texts: How to move order id and order links in Magento2 My Account Page as shown below:


texts: EE 1.14.0.1 catalog search pager item(s) always 1

texts:
For a standard search the collection size is always 1, this is breaking pagination as it always thinks there is 1 item from the search result.

The issue is present on the demo @ http://enterprise-demo.user.magentotrial.com/catalogsearch/result/?q=a

I set a XDebug breakpoint in the Mage_Page_Block_Html_Pager block and looking into the Mage_CatalogSearch_Model_Resource_Fulltext_Collection collection the _getTotals property is always "1", thus "1 item(s)" is always shown.

This issue does not exist on 1.9.0.1

I am still doing some digging to see exactly where _getTotals is set, but has anybody encountered this before?


texts: How can we remove Order History from a customers account page?

texts: So I'm attempting to remove these sections of the Account page, i'm unable to find the reference block can someone help?


texts:
Is there any way in Magento to set up product ranges or collections?

For example, if my store sells clothing such as coats, jackets and shoes and I launch an Autumn range, is there a way to see other products in this range and also a page on the Autumn range?

I was thinking of using the manufacturer feature and changing references from "manufacturer" to "collection" or "range" but wondered if there was a more sensible way of doing this.


texts:
in Gird magento2

 $this->addColumn(
        'edit',
        [
            'header' => __('Edit'),
            'type' => 'action',
            'getter' => 'getId',
            'actions' => [
                [
                    'caption' => __('Edit'),
                    'url' => [
                        'base' => '*/*/edit',
                        'params' => ['store' => $this->getRequest()->getParam('store')]
                    ],
                    'field' => 'id'
                ]
            ],
            'filter' => false,
            'sortable' => false,
            'index' => 'stores',
            'header_css_class' => 'col-action',
            'column_css_class' => 'col-action'
        ]
    );

i want modifie it like


texts: Can't insert data into the database in Mage_Paygate_Model_Authorizenet::_place()

texts:
folks.
Help me please. How can i get information about all authorize.net failed transactions and save it to the db?
I'm trying to do it like this.
Make rewrite of Mage_Paygate_Model_Authorizenet::_place().
Create in this method custom Mage::dispatchEvent and pass to observer response result data.

But for some reasons i can't save this data to database in my observer. Even direct sql query not working.

$resource = Mage::getSingleton('core/resource');
$writeConnection = $resource->getConnection('core_write');
$table = $resource->getTableName('maymodyle/my_table');
$query = "INSERT INTO {$table} (`customer_name`, `error_id`, `authorize_message``) VALUES ('TestFname TestFLname', '3', 'This transaction cannot be accepted.')";
$writeConnection->query($query);

But in my controller or helper this code work just fine.
Any idea why?


texts: How to rewrite model in config.xml only for frontend?

texts:
without any problems I'm able to rewrite a model.
But when it comes to rewrite a model that is used in backend/admin panel and I want that functionality also in the frontend but a little bit different then ... I got a problem.

In the config.xml I have to declare my new rewritten model in the "global" node.
Here it works.

I tried to write it in the node "frontend" but with no effect.

Isn't it possible to do that only for frontend?

<config>
  <frontend>
    <models>
      <custom_name>
        <class>Custom_Name_Model</class>
        <sales>
          <rewrite>
            <order_shipment>
              Custom_Name_Model_Sales_Order_Shipment
            </order_shipment>
          </rewrite>
        </sales>
      </custom_name>
    </models>
  </frontend>
</config>


texts:
I am working on magento project which is been developed by some other team before several years. I need to find out whether there is any changes made by them in core files or not?

I feel it is very difficult to detect any changes done in core files manually. Please share your answers.

P.S. = I am not using any VCS