texts: Magento2: Getting the shipping address input box values in Review & Payments section

texts:
I am creating a module in magento2. Currently my planning is when user will provide the shipping address detail and will click the next button, in back-end I will get the address given by the user , according to that I will send a api request to the shipping api, so that when user views the Reviews and payment section, I can show him/her when the product will be delivered.

But as per above plan, I am stuck at how to handle the next button click and getting the address input.

Please give some hints. So that I can proceed.

I have gone through the discussion in M2: Sending data by clicking Next on checkout. But Not getting any information.

Also searched in google. But no result.

Please help.


texts:
I am created the Custom header and it is working fine. But include child links also showing. I don't want to show child links. Only my custom code will appear How to do.

Block/Header.php

<?php

namespace Learning\TopHeader\Block;

class Header extends \Magento\Theme\Block\Html\Header{

    protected $_template = 'Learning_TopHeader::custom_header.phtml';

}

etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Theme\Block\Html\Header" type="Learning\TopHeader\Block\Header" />
</config>

view/frontend/templates/custom_header.xml

Custom Header


texts: Issue in saving the dropdown list in magento admin

texts: I had created the dropdown list in magento admin.But i am not getting how to save the dropdown list.I have added the dropdown list in below files.Please any one can Help me.


texts:
I want to send some data to header block from a controller. Tried this way. But its not working.

<?php
class Mageart_Iosapi_IndexController extends Mage_Core_Controller_Front_Action{

    public function indexAction()
    {
        $data = "testing";
        $this->getLayout()->getBlock("header")->setData("isodata", $data);
        $this->loadLayout();
        $this->getLayout()->getBlock("head")->setTitle($this->__("Please Wait.."));
        $this->renderLayout();
        $templateImage = $this->getRequest()->getPost('template_image');
        $productId     = $this->getRequest()->getPost('product_id');
        $firstname     = $this->getRequest()->getPost('firstname');
        $lastname     = $this->getRequest()->getPost('lastname');
        $cusemail     = $this->getRequest()->getPost('cusemail');
        $password     = $this->getRequest()->getPost('password');
        $qty           = $this->getRequest()->getPost('qty');

        $arg = array(
            'template_image' => bin2hex($templateImage),
            'product_id' => bin2hex($productId),
            'firstname' => bin2hex($firstname),
            'lastname' => bin2hex($lastname),
            'cusemail' => bin2hex($cusemail),
            'password' => bin2hex($password),
            'qty' => bin2hex($qty)
        );

        if ( (isset($firstname) || $firstname != "") && (isset($lastname) || $lastname != "")
                && (isset($cusemail) || $cusemail != "") && (isset($password) || $password != "") ) {
             $customer = $this->_loadCustomer($firstname, $lastname, $cusemail, $password);
             $this->_redirect('iosapi/index/addtocart',$arg);
        } else {
            Mage::getSingleton('core/session')->addError('Customer Details are Missing.');
            $this->_redirect('checkout/cart');
            $errorStatus = false;

        }
    }
    ...
}

In header.phtml file

<?php echo $this->getData("isodata"); ?>


texts: How to get this form path in Magento 2.0.4?

texts:
app/design/frontend/Venustheme/fasony/Magento_Checkout/templates/cart/shipping.phtml`

Contains this code:

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php /** @var $block \Magento\Checkout\Block\Cart\Shipping */ ?>

            <?php /* @escapeNotVerified */ echo $block->getQuote()->isVirtual() ? __('Estimate Tax') : __('Estimate Shipping and Tax') ?>

What I want to know about is what is $block->getJsLayout(), what was the path for this layout ?


texts:
sudo php bin/magento setup:upgrade -vvv
Cache cleared successfully
File system cleanup:
PHP Fatal error:  Uncaught Error: Cannot use object of type Closure as array in /var/www/croquenoix/dev/croquenoix/web/setup/src/Magento/Setup/Model/Installer.php:1288
Stack trace:
#0 /var/www/croquenoix/dev/croquenoix/web/setup/src/Magento/Setup/Model/Installer.php(1013): Magento\Setup\Model\Installer->cleanupGeneratedFiles()
#1 /var/www/croquenoix/dev/croquenoix/web/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php(72): Magento\Setup\Model\Installer->updateModulesSequence(false)
#2 /var/www/croquenoix/dev/croquenoix/web/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Magento\Setup\Console\Command\UpgradeCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/croquenoix/dev/croquenoix/web/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 in /var/www/croquenoix/dev/croquenoix/web/setup/src/Magento/Setup/Model/Installer.php on line 1288

The stack trace is not long enough for me to figure where the error really comes from. How can I see a longer stack trace? How can I debug this error?


texts: Is it possible to add a template to a theme in magento 2?

texts:
Current situation: I have created a custom theme that extends from the Magento blank theme.

Requirement: I need to add a section that contains some small images to the footer for the whole site.

Possible solution: keeping with Magento's modular templates, add a template, extend the default.xml layout which references the template.

I have tried to add the template as follows:

<referenceContainer name="footer-container">
<block name="footer.advisories"
       class="Magento\Framework\View\Element\Template"
       template="Extending_theme::html/footer_advisories.phtml" />

</referenceContainer>

This produces an invalid template error.

I have also tried template="html/footer_advisories.phtml".

My question is, is it possible to create a template in a theme? If so, how can i reference it? If not, have you any suggestions how I might do this?

I was thinking about creating a custom module, but this seems overkill for what I am trying to achieve.

Thank you in advance, Andy


texts:
After customer login Some times I get same and some times get different id's from these two lines why?(I know one is for admin side and one is for frontend but it should sync)

$id1 = $quote = Mage::getModel('sales/quote')->loadbycustomer($session- >getId())->getId();
$id1 = $cart = Mage::getModel('checkout/session')->getQuote()->getId();

and if use any of line to add product to cart always I get price and subtotal of products null do not know why?

But If I use 'checkout/cart' in that case price and subtotal show. But I can not use that for logged in users.


texts:
I just read through the documentation for Payment Failed Emails which says:

  A notification is sent to the customer if the payment method that is chosen during checkout fails to complete the transaction.

What does this really mean? Is an email sent is during the checkout? Or after the checkout and payment is completed and for some reason, the payment method does not work?

I've just set it up in a sample Magento 2.1.0 and no emails are sent when there are payment errors. Just a brief message saying Unable to place order. Please try again pops up and disappears.

Thanks.


texts: Magento: How to remove certain States from state/region list at Checkout or registration?

texts:
The list of regions for USA contains: Alaska, Hawaii, American Samoa, Guam, Marshall Islands, Micronesia and Armed American and so on.
This is the list that is available both during registration and on checkout.

So If someone want to remove the state/region named Alaska, Hawaii, American Samoa, Guam, Marshall Islands. How we can achieve this?


texts: Magento 2 : Getting PHP variable in js extended template

texts:
I added a step in Magento 2 checkout process.
by extending a template using .js file

return Component.extend({
            defaults: {
                template: 'vendor_module/mytemplate.phtml'
            },

And it is working fine.
but i need to add some dynamic content to the page, fetching data from a custom table in db and display them in the template.

How can I achieve that.
Adding My code bellow

Js File

define(
[
'ko',
'uiComponent',
'underscore',
'Magento_Checkout/js/model/step-navigator',
'Magento_Customer/js/model/customer'
],
function (
    ko,
    Component,
    _,
    stepNavigator,
    customer
    ) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'vendor_module/template_file.phtml'
        },

         isVisible: ko.observable(true),
        isLogedIn: customer.isLoggedIn(),
         stepCode: 'stepCode',
         stepTitle: 'stepTitle',

        initialize: function () {
            this._super();
            stepNavigator.registerStep(
                this.stepCode,
                null,
                this.stepTitle,
                this.isVisible,

                _.bind(this.navigate, this),

                15
                );

            return this;
        },

        navigate: function () {

        },

        navigateToNextStep: function () {
            stepNavigator.next();
        },

         getCustomData: function () {
            var customData = window.checkoutConfig.customData;

            return customData;
        },
    });
}
);

PHP File

    <?php

namespace vendor\module\Model;

use Magento\Checkout\Model\ConfigProviderInterface;

class CustomConfigProvider implements ConfigProviderInterface
{
    public function getConfig()
    {
        $config = [];
        $config['customData'] = 'Your text.';
        return $config;
    }
}

template_file.phtml


texts: Adding shipping address in sales notification email

texts:
I am trying to add shipping address to the default Magento sales notification email but the list of variables that I get after pressing "insert variable" does not have shipping address as a variable.

How do I go about adding this as a variable? I am new to Magento and it will be great is someone can tell me how does this email get triggered? There are methods in Order.php that get accessed but which code really calls those methods?


texts:
I try to install a simple module for my admin dashboard but no result.

<?xml version="1.0"?>
<config>
    <modules>
        <Azerty_Adminhtml>
            <active>true</active>
            <codePool>local</codePool>
        </Azerty_Adminhtml>
    </modules>
</config>

I wish my theme here: www\app\design\adminhtml\mytheme\default

<?xml version="1.0"?>
<config>
    <stores>
        <admin>
            <design>
                <package>
                    <name>MyTheme</name>
                </package>
                <theme>
                    <name>default</name>
                </theme>
            </design>
        </admin>
    </stores>
</config>

Thanks for your help.


texts:
How to filter products shown on the category pages based on the products attributes???
I should be able to filter the products based on the attributes such as manufacturer price color etc shown on the layered navigation menu.


texts:
I have listed some products in my custom home page template.

I have tried to get price html in home page but its not working.

In magento 1.9 below code is used to load price template

 $_product = Mage::getModel('catalog/product')->load($product->getId());
      $productBlock = $this->getLayout()->createBlock('catalog/product_price');
      echo $productBlock->getPriceHtml($_product);

How to load this price template in magento 2

I tried below code

$blockObj= $block->getLayout()->createBlock('\Magento\Catalog\Block\Product\ListProduct');
                echo $blockObj->getProductPrice($_product);

But it returns 1 rupee as a price


texts: I'm trying to install magento's module, but it shows that I have missing PHP extensions. Sadly, it doesn't show which one is missing. I've activated all php extensions available in php.ini of my wamp64 server, but it didn't help. Do you know what should I be looking for?


texts: Enable customers to make payment via cc after order is placed

texts:
Can someone guide me on how to enable customers to pay via cc for orders already placed?

In this case, a customer can place an order and select wire transfer but I want to give them the possibility to make payment via credit card after.
I already made an extension to add the custom page which loads the order with status new in customer dashboard. Now, I want when they click "Make Payment" to be redirected either to a page where they can enter the cc details or.. do I need to recreate the checkout/onepage process? In makepaymentAction I grabbed the order id so my link looks like: "localhost/pendingpayment/sales_order/makepayment/order_id/1228/"

Any help will greatly be appreciated!
Thank you!

**--EDIT--**

The credit card payment is based on Magento's credit card payment template and the payment is made through Firstdata payment gateway api.
As I said, what I want is when a user does not complete the payment or if he selects wire transfer for example, to see this order in account dashboard (achieved that already) and the Make Payment button should take him to either a page where the credit card form template is loaded or a popup and a "Pay" button. Can I mimic the Place Order Now button action to update the order (status) and save/process the payment?


texts: How can I move the advanced search into the left sidebar of my homepage? No one seems to have been able to give me an answer so far and I would really like to know how this can be done. Thankyou


texts:
When I use the layered navigation links on my category page to go to a sub-category, the link removes a letter from the category name.
For example: my category url is example.com/bathroom
When i click any sub-category link the link turns into example.com/athroom/sinks
(missing b from bathroom is intentional)
Is there any reason for this as it happens on the Luna theme and my custom theme.
There's nothing in the URL rewrites pertaining to this.
I don't want to just use a URL rewrite to fix this as it seem janky.


texts: Magento Community 1.9.1 RWD theme: Home page "add to cart" failure

texts:
I just noticed that when I used the 'add to cart' button on the home page of my site, it doesn't work in Firefox or IE.... it only brings me to an empty cart. It does work in Chrome however. I've cleared the caches so I know it's not a cache problem? Please confirm and advise. tia

Update: It doesn't work in chrome either. after further investigating, I found that that If I disable the Cache management setting : Blocks HTML output... it works fine. I turned it off for now. I can turn it back on for debugging.

http://kaleidoscopiacoloringbooks.com/Store/


texts:
I'm new to Magento 2 and I'm trying to create a module that uses Zend Json Server.

The initial code in the module controller was (in Magento 1):

public function postAction()
{
$server = new Zend_Json_Server();
    $client = new MyClientClass();
    $server->setClass($client);
    $server->handle();
}

How do I replace it in Magento 2?
Thanks


texts: Common Custom Option for multiple products in magento1.9.3.2?

texts:
Am having a custom option as "message to be displayed on the product" and "Delivery Date" for a product and I want to use this same custom option for multiple products. Is there anyway to use custom option for multiple products or any free extension is available?
Can anyone help?


texts:
For Moscow, the time zone of GMT +3 should be set. But in fact, for Moscow is established GMT +4. As a result, in the whole system of Magento (in orders, email, etc.) I get time for +1 more than now.
How can this be remedied? It looks like a bug.

In the configuration selected Europe/Moscow timezone.

P.S. Time zone GMT +4 operated for Moscow in 2014, then it was transferred to GMT +3.

Magento 2.2.4, CentOS 7.5


texts: Possible To Add Item To Cart While One Page Checkout

texts:
Our site needs to be be able to add an item to the cart based on the users shipping location during the checkout process, for instance if they are shipping to Canada, a surcharge with a SKU will need to be added, it's a requirement of the ERP for the surcharge to be represented as an item with a SKU.

Is it possible to add an item to the cart while the user is on the one page checkout after the user chooses the shipping method? And based on location chosen add the surcharge product without redirecting the user back to the cart page?

I've done some research and so far I found that I can tie into an Observer event using the following

controller_action_predispatch_checkout_onepage_saveBilling

but from what I can tell, if the cart is updated while on the one page checkout, the user is auto redirected back to the cart page.  I'm a little stumped so any help would be appreciated.


texts: Magento 2: Issue with elastic search layered navigation

texts:
I use custom template SM Market.
It's about a search engine. Works fine on Luma.
But in my custom theme, Instant Search is not working.
The module does not seem to know to use the search engine from the custom theme and use only base search engine from Luma Magento.
Does anyone know how I can say that elastic search layered navigation uses the search engine from my theme?


texts: How to add new address type (customer address) in magento2

texts: how can I add three new address types same as billing and shipping in magento2?


texts: How to pass params to uiComponent without caching?

texts:
I have some issue with initialization uiComponent and passing parameters to component.

So I have code, example below:

 <?php

// @codingStandardsIgnoreFile

/** @var \Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist $block */
$productStatus = $block->getData('productStatus');
?>
<?php if ($block->isWishListAllowed()) : ?>
    <div data-bind="scope: 'wishListComponent'">
        <!-- ko template: getTemplate() --><!-- /ko -->
    </div>

    <script type="text/x-magento-init">
        {
            "*": {
                "Magento_Ui/js/core/app": {
                    "components": {
                        "wishListComponent": {
                            "component": "addToWishlistComponent",
                            "params": <?= /* @noEscape */ $block->getWishlistParams() ?>,
                            "isAdded": "<?= /* @noEscape */ $productStatus->isAddedToWishlist($block->getProduct()) ?>"
                        }
                    }
                }
            }
        }
    </script>
<?php endif; ?>
<script type="text/x-magento-init">
    {
        "body": {
            "addToWishlist": <?= /* @noEscape */ $block->getWishlistOptionsJson() ?>
        }
    }
</script>

My problem - i can`t pass correct data on this line:

"isAdded": "<?= /* @noEscape */ $productStatus->isAddedToWishlist($block->getProduct()) ?>"

Because Magento cache it and after each reloading page i get the same data, but after reloading page data should be changed, and i have to get changed data (  It work correctly only after cache clearing, but it is not what i want.

So. How i can solve this (without turn off cache) ? Maybe my solution is wrong and there is better way to pass data like this ?
Thanks )


texts: PayPal Express Checkout with Currency from the Currency Switcher

texts:
Out of the box Magento's PayPal Express seems to always resolve the currency to the base currency (e.g. GBP). But on a website where a choice of currency is given to a customer using the currency switcher (e.g. GBP, EUR), if a customer chooses a currency other than the base currency (e.g. EUR), Magento always seems to pass the base currency to PayPal. My PayPal sandbox account can accept has both GBP and EUR.

Is there anyway to use the currency switcher's currency (i.e. quote_currency_code) as oppose to the base currency?


texts: Simple Products not showing as associated in configurable products

texts:
I need to ask about how to set up a simple product to be able to show it to my configurable associated products.

I think I already configure all the attributes like,

visibilty     = not show inidividually
stock         = in stock
attribute set = the same as configurable product
price         = also set
status        = enable

anything I missed? Because when go to my configurable product some of my simple products created wouldn't show up as Associated Products.


texts: Add  text to right of logo in rwd for large layout only

texts:
I'm talking about the "Madison Island" graphic in the top left: http://enterprise-demo.user.magentotrial.com/. I just want a slogan where the white space is, and it doesn't need to be in the small layout. I tried adding

My Cool Site

to app/design/frontend/rwd/default/template/page/html/header.phtml but that showed it in all layouts.


texts: how to add a class to the select field in multishipper (addresses.phtml) without editing the core

texts:
hi i want to add a class to the select field in the multishipper addresses.phtml screen. the function is

 echo $this->getAddressesHtmlSelect($_item, $_index)

that is calling the select with addresses droplist.
this function is found in Addresses.php

  public function getAddressesHtmlSelect($item, $index)
    {
        $select = $this->getLayout()->createBlock('core/html_select')
            ->setName('ship['.$index.']['.$item->getQuoteItemId().'][address]')
            ->setId('ship_'.$index.'_'.$item->getQuoteItemId().'_address')
            ->setValue($item->getCustomerAddressId())
            ->setOptions($this->getAddressOptions());

        return $select->getHtml();
    }

i thought that the options would work because the select field is generated with the class attribute empty.

i tried the following syntax $this->getAddressesHtmlSelect($_item, $_index, 'form-control') without success..


texts: How to add label to address field in magento customer address?

texts:
I want to add address field label to address field 2 in Magento admin panel. I want to add label House number in customer address field where Address will be in address line 1 and the new label will be in address line 2.

Thank you


texts: Magento 2 : Image Validation is not working in back end form

texts:
I have a custom module which manage to upload the banners.

Everything working fine except image validation.

Below is my code for the image in

  app/code/E25media/Bannersmanager/Block/Adminhtml/Banners/Edit/Tab/Main.php

<?php
namespace E25media\Bannermanager\Block\Adminhtml\Banners\Edit\Tab;

class Main extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface
{
   /* -- some code here */
protected function _prepareForm()
{
     /* -- some code here */
     $fieldset->addType('image', '\E25media\Bannermanager\Block\Adminhtml\Banners\Helper\Image');

$fieldset->addField('banner_image_mobile', 'image', array(
'name'      => 'banner_image_mobile',
'class'     => 'required-entry required-file',
'label' => __('Mobile Banner Image'),
'title' => __('Mobile Banner Image'),
'required'  => true,
'disabled'  => $isElementDisabled));

  /* -- some code here */
 }

My form file upload is look like this.

But i can submit the form without uploading the image.

How to validate the image file ?


texts:
My problem came out when we tried to install an extension...then we tried to install another two or three but none of them are working. We cannot have any working extension on our version of Magento (CE 2.2.1) - I am sorry for not being an expert, but I need to paste what a developer said, without understanding too much of it. Is it about permissions on the webserver?How can I get them fixed? Thank you!

  But I think when they run the command to generate the static files
  something is wrong with the permissions or web user that makes the
  process to fail Because if the extension is working fine in
  testing/developer mode, there is no reason why it wouldn’t work in
  production site"

  Do you know how to generate static files in magento? Could you check if anything is failing in that regard?


texts: Can anyone recommend a robust "catalog management" plugin for Magento 2 cloud? One preferably that allows for feature-rich control from the Dashboard/Admin level? I realize there might be a bit of dev work involved in setting it up but once that portion is done, it will allow for let's say, the marketing team to have a lot of control within Admin panel. Apologies if I'm not phrasing this correctly but I'm sure you get the gist. Any help is appreciated. Thanks.


texts: Newsletter confirmation while subscribed on registration page

texts:
Newsletter confirmation is enabled - user receives an e-mail message with link to agree subscribing to newsletter when he subscribes from newsletter form on homepage.

Unfortunately, on registration page when user checks checkbox he wants subscribe to newsletter, he subscribes to newsletter automatically without confirmation.

It makes possible to subscribe anyone.

Is there any option to enable confirmation when user subscribes from registration page?

Thanks.


texts: Magento 2 - Override info.phtml from Module Sales

texts:
I have a custom module and I want to override a .phtml file.

This is what I want to override:

  magento/vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml

My module.xml:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="UV_Adressen" setup_version="0.0.1">
        <sequence>
            <module name="Magento_Sales"/>
        </sequence>
    </module>
</config>

Here I created the file in my module:

  UV/Adressen/view/adminhtml/templates/order/view/info.phtml

I also created a layout-file:

  UV/Adressen/view/adminhtml/templates/order/layout/sales_order_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_info">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">UV_Adressen::order/view/info.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

After I executed

  setup:upgrade and setup:di:compile

it still loads the core template file.

Thanks in Advance!


texts: Magento 2 How to display placeholder image to image preview backend UI component form

texts:
In my custom module i have custom UI component form and i add file upload filed to this form.

Form is working fine while Add or Edit, when upload file image preview is display,but i want to display default image preview once file is not uploaded and display a placeholder image to image preview section.

Below is image upload code.

<field name="image">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">string</item>
                <item name="source" xsi:type="string">image</item>
                <item name="label" xsi:type="string" translate="true">Image</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="formElement" xsi:type="string">fileUploader</item>
                <item name="placeholderType" xsi:type="document">document</item>
                <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                <item name="previewTmpl" xsi:type="string">Namespace_Modulename/image-preview</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
                <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="url" path="managelabels/productlabel/upload"/>
                </item>
            </item>
        </argument>
    </field>

After search a lot and found something to display placeholder image this link. in this documentation they use placeholderType argument to Defines the preview type.

But i have no idea to how to implement this argument to my custom form.

Any help would be appreciated!Thanks


texts: How can i export multiple table values as a single file specific store

texts:
I need to export different tables values as same file,

Name - sku - category url - image path

Name:

category_products_entity_varchar :: [ value as name]  {attribute_id = 71}

Sku:

catalog_products_entity :: [sku]

category url:

category_products_entity_varchar  [value as category] {attribute_id = 57}

image path :

category_products_entity_media_gallery [value as image path]


texts: Zero tax for those with valid VAT Number (maybe via customer groups)

texts:
I wish to charge zero tax if a customer has a valid VAT Number.

I can add a VAT Number to an address and I receive the message "Your VAT ID was successfully validated. You will not be charged tax.". But tax is still added in the cart.

I have also used Configuration > Customers > Customer Configuration > Create New Account Options > Enable Automatic Assignment to Customer Group which allows me to assign a customer to a different Customer Group if their VAT Number is verified. But from this I can't find a combination of settings to achieve zero tax for that group and 20% tax for the General group.

I'm on Magento 2.1.5. Ideas welcome!


texts: New order email from admin panel can only be sent once per session

texts:
Magento 2.3.4 here.

I can only send out 1 order email  per admin session from the admin panel. Then it fails with no error message.

If I log out and in again I can send another email. But just one.

Anyone has any idea how to fix that?

Thanks!


texts: How are Order States/Statuses translated?

texts: Suppose I have a website with English and German store views. I only see a single global mapping of states to statuses at /admin/sales_order_status, so it's not clear how I would have an order state show up differently in different languages. Is that possible?


texts: Error while installing magento 2.4 with php8

texts:
I am installing magento 2.4.1 with php8 and it is giving me following error
Deprecated: Method ReflectionParameter::getClass() is deprecated in C:\xampp\htdocs\m2\vendor\magento\framework\Code\Reader\ClassReader.php on line 34

please help.
Thanks!


texts: Why multishipping is disabled for items with decimal qty?

texts:
From Mage_Checkout_Helper_Data

/**
 * Check if multishipping checkout is available.
 * There should be a valid quote in checkout session. If not, only the config value will be returned.
 *
 * @return bool
 */
public function isMultishippingCheckoutAvailable()
{
    $quote = $this->getQuote();
    $isMultiShipping = (bool)(int)Mage::getStoreConfig('shipping/option/checkout_multiple');
    if ((!$quote) || !$quote->hasItems()) {
        return $isMultiShipping;
    }
    $maximunQty = (int)Mage::getStoreConfig('shipping/option/checkout_multiple_maximum_qty');
    return $isMultiShipping
        && !$quote->hasItemsWithDecimalQty()
        && $quote->validateMinimumAmount(true)
        && (($quote->getItemsSummaryQty() - $quote->getItemVirtualQty()) > 0)
        && ($quote->getItemsSummaryQty() <= $maximunQty)
        && !$quote->hasNominalItems()
    ;
}

This check !$quote->hasItemsWithDecimalQty() will disable multishipping for items with decimal qty. Any one knows the reason behind it?


texts: We have consumer customer group and wholesale customer group. How can I implement quantity increments by product AND restrict it by customer group? Or exclude customer group from quantity increments. I googled 1000 hours for an extension but it doesnt exist.


texts: How to add a custom dropdown menu in Magento2 to a PHTML template

texts:
How can you add a custom dropdown menu in a Magento PHTML template?

So far, I've created the template in my theme and the markup is showing on the frontend.

This is the markup I'm using

    <button class="action toggle"
            data-mage-init='{"dropdown":{}}'
            data-toggle="dropdown"
            aria-haspopup="true">
        button + dropdown
    </button>

            One

            Two

            Three

But the drop down is not being initialized by javascript, it's just showing the normal HTML.  I thought data-mage-init='{"dropdown":{}}' would initialise the dropdown widget but it doesn't.

Do I need to add a script, similar to how they have done in app/code/Magento/Customer/view/frontend/templates/account/customer.phtml with:

I'm not sure what "component": "Magento_Customer/js/view/customer" is for?

UPDATE

I found I could add a tooltip with...

    About

            One

            Two

            Three

I can't find anyway of doing the same to get a dropdown, is there a way to do this?


texts: Route /checkout/cart/add gives 404 error after update

texts:
After updating from 2.1.9 to 2.1.17 the /checkout/cart/add URL now responds with a 404. I checked .htaccess file, unable to find a difference.

Any ideas where this route is defined? How do I debug?


texts: How to programmatically add attribute option values in data upgrade script?

texts: I want to programmatically add new product option values in a data upgade script of my module. How can I do this?


texts: Override Magento\Sales\Model\Order\Email\Sender\CreditmemoSender Magento 2

texts:
How to override below file in module ?
Magento\Sales\Model\Order\Email\Sender\CreditmemoSender.php


texts:
I have a question. What would I need to do to have a image overlay for sold out products. This basically should cause the image to be "grayed out" (so a gray overlay with opacity at 60% or something like that), so that you can still see the image but it is clearly out of stock because the whole thing is grayed out. It doesn't need to say out of stock or anything like that.

I've looked for an extension that would do that and wasn't able to find it. The closest I found was doing something with css and using a z-index to overlay the image but I'm not sure how well that would work.

Thanks :)


texts: Multiselect price filter attribute in layered navigation

texts:
I want to implement Price filter with multi select in layered navigation. It is looking like this.
Price:

0 - 5000
5000 - 10000
10000 - 15000
15000 - above

I have succeeded with other multi select filter attributes.
Can you please help me on this. Thanks in advance.


texts:
i have wrote a observer based on event salesrule_validator_process

<events>
    <salesrule_validator_process>
        <observers>
            <test_test>
                <type>model</type>
                    <class>test_test_Model_Observer</class>
                    <method>test</method>
            </test_test>
        </observers>
    </salesrule_validator_process>
</events>

the function

public function test($observer) {
    ......

    $connection->insert('test_test', $__fields);

    .....
}

the function has ran twice, inserted two records to DB, anyone know how to fix it?


texts: Programaitically Insert Values for Dynamically Created Rows

texts:
I am working on creating an Magento REST API which passes values to dynamic rows of Stores->config. Dynamic rows were already created through frontend & backend Models.
I just need to insert values through API
Here is a snippet of code I tried
 $values=[
            'service'=>'test label',
            'token'=>'1234567890',
            'value'=>1
        ];
        $this->_configWriter->save('integration/general/tokens',$values,ScopeConfigInterface::SCOPE_TYPE_DEFAULT,0);

But the values are not getting populated. Any help would be appreciated


texts: Disable validation for customer address in create customer account

texts:
I need to disable validation for few customer adress fields in customer/account/create/ (but only on this page).

Seems like i've messed up with names and can't find out how to fix my code.
Folder structure:

Mycompany
|__Mymodule
   |__controllers
      |__Customer
         |__AccountController.php
   ect
   |__config.xml
   Model
   |__Customer
      |__Address.php
      |__Customer.php

config.xml

...
<global>
    <rewrite>
        <mycompany_mymodule_customer_account_create>
            <from><![CDATA[#^/customer/account/create/$#]]></from>
            <to>/mymodule/customer_account/create</to>
        </mycompany_mymodule_customer_account_create>
        <excellence_address_customer_account_createPost>
            <from><![CDATA[#^/customer/account/createPost/$#]]></from>
            <to>/mymodule/customer_account/createPost</to>
        </mycompany_mymodule_customer_account_createPost>
    </rewrite>
    <models>
        <customer>
            <rewrite>
                <customer>Mycompany_Mymodule_Model_Customer_Customer</customer>
                <address>Mycompany_Mymodule_Model_Customer_Address</address>
            </rewrite>
        </customer>
...
etc

validate() function will be overridden in Address.php

public function validate()
{
   // my validation
}

By filling form under customer/account/create/, even if I've removed 'required' class in form and removed in customer_register_address customer_form_attribute for every attribute_id I don't need @ registration page (e.g. street, city etc.), I still got validation warning message:

Please enter the street.
Please enter the city.
etc


texts: Source model not found for custom product attribute "brand_pro"

texts:
I have created one custom module for product attribute.I am getting this error.Can anybody tell why is this error coming?? below i have given all the files that are required.I am not getting the error please can some one help me out with this ..
My code id as follows
config.xml

   <?xml version="1.0"?>
  <config>
  <modules>
    <AdminModules_Brandattr>
        <version>1.0.0</version>
    </AdminModules_Brandattr>
</modules>
<global>
    <models>
        <brandattr>
            <class>AdminModule_Brandattr_Model</class>
        </brandattr>
    </models>
    <resources>
        <brandattr_setup>
            <setup>
                <module>AdminModules_Brandattr</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </brandattr_setup>

        <brandattr_write>
            <connection>
                <use>core_write</use>
            </connection>
        </brandattr_write>

        <brandattr_read>
            <connection>
                <use>core_read</use>
            </connection>
        </brandattr_read>
    </resources>
</global>

<adminhtml>
    <events>
        <catalog_product_prepare_save>
            <observers>
                <brandattr>
                    <class>brandattr/observer</class>
                    <method>productSave</method>
                </brandattr>
            </observers>
        </catalog_product_prepare_save>
    </events>
</adminhtml>

installer file

  $installer = $this;
  $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
  $installer->startSetup();

 $setup->addAttribute('catalog_product', 'brand_pro', array(
'group'         => 'General',
'input'         => 'select',
'type'          => 'text',
'label'         => 'Brand',
'source'        => 'brandattr/product_attribute_source_unit',
'backend'       => '',
'visible'       => 1,
'required'      => 0,
'user_defined'  => 1,
'searchable'    => 1,
'filterable'    => 0,
'comparable'    => 1,
'visible_on_front' => 1,
'visible_in_advanced_search'  => 0,
'is_html_allowed_on_front' => 0,
 'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,

));

$installer->endSetup();

unit.php

 <?php

   class AdminModules_Brandattr_Model_Product_Attribute_Source_Unit extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
 {
public function getAllOptions()
{
    if ($this->_options === null) {
        $this->_options = array(
            array(
                'value' => '',
                'label' => '',
            ),
            array(
                'value' => '1',
                'label' => 'Only',
            ),
            array(
                'value' => '2',
                'label' => 'Vero Moda',
            ),

        );
    }
    return $this->_options;
  }
 }

?>


texts: How to restrict the number of products in a collection and modify search filters accordingly?

texts:
UPDATE: this is partially answered(for someone who comes here lately).The answers does not updated the search filters.

I want to limit my product collection in any category/subcategory landing page with the help of a url parameter say itemlimit=10

I tried to do this in my phtml with setPageSize(3) but this is setting the number of product in a page so the filters wont get modified accordingly.

Then i tried to do it with

$collection->getSelect()->limit(10);

and getting an error like this

Unrecognized method 'setCurPage()'

Am I doing the wrong thing? Should I override the catalog resource model collection for this?

EDIT:

This is my custom block class

class Ziva_Customcatalog_Block_Product_List extends Mage_Catalog_Block_Product_List {
    public function __construct() {
        parent::__construct();
    }

    protected function _getProductCollection() {
        $collection = Mage::getModel('catalog/product')->getCollection();
        return $collection->getSelect()->limit(10); // This will first 10 results
    }
}

EDIT as asked:
the entire trace

#0 C:\wamp\www\magento2\app\code\core\Mage\Catalog\Block\Product\List\Toolbar.php(225): Zend_Db_Select->__call('setCurPage', Array)
#1 C:\wamp\www\magento2\app\code\core\Mage\Catalog\Block\Product\List\Toolbar.php(225): Varien_Db_Select->setCurPage(1)
#2 C:\wamp\www\magento2\app\code\core\Mage\Catalog\Block\Product\List.php(158): Mage_Catalog_Block_Product_List_Toolbar->setCollection(Object(Varien_Db_Select))
#3 C:\wamp\www\magento2\app\code\core\Mage\Core\Block\Abstract.php(862): Mage_Catalog_Block_Product_List->_beforeToHtml()
#4 C:\wamp\www\magento2\app\code\core\Mage\Core\Block\Abstract.php(582): Mage_Core_Block_Abstract->toHtml()

..................................................
    #27 C:\wamp\www\magento2\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
    #28 C:\wamp\www\magento2\app\Mage.php(683): Mage_Core_Model_App->run(Array)
    #29 C:\wamp\www\magento2\index.php(87): Mage::run('', 'store')
    #30 {main}


texts: Magento 2 Related products add to cart button issue

texts: I'm using Magento 2 and I've noticed that on the related products block , on the product page , the add to cart button for the related products is actually a check box, and not a properly button.. is there any setting for that to be a properly button ?


texts: Magento External File(Parallel to index.php): Can't check customer is logged in & total cart items

texts:
I have added an external file as same as index.php & having below code.

 require_once 'app/Mage.php';
Mage::app();
$isLoggedIn = 0;
$isCartItems = 0;

if (Mage::getSingleton('customer/session')->isLoggedIn()) {
    $isLoggedIn = 1;
}

$isCartItems = Mage::helper('checkout/cart')->getSummaryCount();

echo $isCartItems;
echo $isLoggedIn;

But, unfortunately i can't get correct values of above variables. Its always returning 0

Can anyone help please.


texts:
I am learning magento and I have some doubts about how it works, could someone help me with it or can suggest some tutorial from where I can learn more about magento. In

/app/design/frontend/../../template/catalog/product/widget/new/content/new_grid.phtml

file there is a piece of code

$this->getProductCollection()

I know this function can be found in

/app/code/core/Mage/Catalog/Block/Product/Widget/New.php

But there is no such function, I also looked in the parent class and there also I could not find this function.

I found another function in

/app/code/core/Mage/Catalog/Block/Product/Widget/New.php

Below is the function

protected function _getProductCollection()
{
    switch ($this->getDisplayType()) {
        case self::DISPLAY_TYPE_NEW_PRODUCTS:
            $collection = parent::_getProductCollection();
            break;
        default:
            $collection = $this->_getRecentlyAddedProductsCollection();
            break;
    }
    return $collection;
}

and I know this function is called but my question is why and how? These two have different names then how they can be same. Do it means that "_" is only used if a function is protected and it does not have to do anything with the function name.

And also when I echoed

$this->getDisplayType()

then I got 'new_products' but if you see in this function then magento is using self::DISPLAY_TYPE_NEW_PRODUCTS in case then how these two cases or strings are similar.

Also please explain this line

parent::_getProductCollection()

do it means call _getProductCollection() from parent class and if yes then where this is specified in magento.


texts:
I've been having the problem for about a week and I cannot find a work around. I can't seem to install extensions at all.

I am using Magento 1.9.0.1 and when I go to Magento connect I get a 404 error. I have tried CHMOD downloader & downloader/index.php to 644 but still get 404.

Is there a workaround or a way to manually install extensions? When I have tried via FTP it tries to overwrite existing files which it shouldn't.

Thank you!


texts: Reason behind strange per-item discounts for bundled products?

texts:
When bundled products, which have simple products associated to them, are purchased, and a cart-wide discount (Shopping Cart Price Rules) is given, the per-item discounts are very strangely divided up. See screen shot for an example. Is there a reason to this strange calculations?

EE 1.13 vanilla instance.

Discounts seem to be divided according to the Price column.

Discount is split unevenly. (first bundled product is shipped, but it's irrelevant)


texts: Help with Product Import on Magento 1.9 to 2.2.4

texts:
We are in the process of migrating a site from Magento 1.9.3.1 to 2.2.3. This site has over 11k products, 25k orders.

We used the official Magento migration tool but were unsuccessful since the product details were shuffled, in the sense, the description was in the title, the pricing was in the description, etc.

Post that we used a third party tool called https://www.ubertheme.com/question/magento2_data_migration-master-zip/.

With this tool, we were able to import the products and everything seems alright in the backend (admin panel) but on the frontend (the theme) none of the products get listed. We reverted the theme to the default Magento theme and the issue continued to persist.

This is where we are stuck at this point.

We have followed several other instructions from different blogs to fix this issue. These are the steps failed

Reindexed the database
Used DI compile command for the catalog module
deleted cache files and used static content deploy, Used Magento
upgrade command
re-setting value of Stores/Configuration/Catalog/Inventory/Stock
Options/Display Out of Stock Products to ‘Yes’
Rechecked the products have visibility on the main website and made
sure they are enabled
updated the customer_group_id in the customer_group table for NOT
LOGGED IN USER to 0
updated vendor/magento/module-eav/Model/ResourceModel/Readhandler.php
to the latest git version

The current theory that we have is that  there is a problem with either EAV table group migration or
minor changes in any tables causing catalog->category->product relationship.

We would very much appreciate insights/help/ help at this point.


texts: How to create full url of store using jQuery in Magento 2?

texts:
I was facing one big issue to access base URL of store in custom module through jQuery object in magento 2.

In PHP, generally it can obtain using $this->getUrl('module/controller/action'); but in jQuery object how we can obtain same ?

In checkout module we seems, there is usage of this.getUrl() method. And its working fine.

After giving hours of dedication I found the solution. and It will be helpful to you.


texts:
I just installed Magento 2 webkul advanced layered navigation. but wen I use it as composer, I get below error:

  [RuntimeException]
    Source class "\Webkul\AdvancedLayeredNavigation" for "\Webkul\AdvancedL
    ayeredNavigation\Logger" generation does not exist.

This is my composer.json:

{
"name": "webkul/navigation",
"description": "Advanced Layered Navigation For Magento2",
"type": "magento2-module",
"version": "2.0.2",
"license": [
    "proprietary"
],
"autoload": {
    "files": [
        "registration.php"
    ],
    "psr-4": {
        "Webkul\\AdvancedLayeredNavigation\\": "src/app/code/Webkul/AdvancedLayeredNavigation"
    }
}
}

What should I do?


texts:
Magento 2: 2.3.1 Is there a way to 'compact' or improve the UX of the Magento 2 backend?

Coming from M1 we love the new Wordpressy kind of look of Magento 2. But ... it does take up a lot of space. And after installation of some modules again all the main menus fill up (are Vendors still allowed to enter items into the top navigation level ???!!), settings menus and list become very wide and fll of the screen. The icons in the left navigation bar go down far and we have to scroll. Also we feel half of the screen is taken up by the header part.

Question: is there a compact modus? or other method to make better use of the screen in the Magento 2 backend?


texts: Mass action delete not working on Magento 2.1.9

texts:
I have created a backend module on magento 2.1.6 which was working fine on the mass delete action.

After upgrading magento with version 2.1.9, now if i tried to make a mass delete i receive this next err :

Uncaught Error: Call to undefined method namespace\module\Model\ResourceModel\Post\Grid\Collection::_getAllIdsSelect();

on this function:

  public function getAllIds($limit = null, $offset = null)
    {
        return $this->getConnection()->fetchCol($this->_getAllIdsSelect($limit, $offset), $this->_bindParams);
    }

Does anyone know how to solve this issue?


texts: Order Date is correct on the order itself in Admin but incorrect in the Order Confirmation Email (it shows exactly 7 hours more)

texts:
The orders show the correct Order date in Admin but incorrect Order date (time) on the Confirmation Email. The time on the Confirmation Email is exactly (to the second) 7 hours more.

An example:

Order Date in Admin (this is correct):  Jan 26, 2016 8:38:29 AM

Order Date on the Order Confirmation Email (incorrect): Placed on January 26, 2016 3:38:29 PM

Any ideas? :-)


texts:
Our client wants to integrate DEAR Inventory with Magento. We have set up the web service user and role on Magento and completed the setup on the DEAR side but when we try to import the products from Magento to DEAR we get the following error:

Failed to load products/options: CommunicationException: Error in deserializing body of reply message for operation 'catalogProductList'.

Has anyone else encountered this issue and can someone help to resolve it.

Thanks in advance


texts: magento override checkout onepage progress block

texts:
What should i write in my module's config file to override checkout progress block on checkout onepage in magento.

progress phtml is coming from my module after putting folowing code in config and my module's layout file.

In config file
<blocks>
    <checkout>
      <rewrite>
         <onepage>Mymodule_Verification_Block_Checkout_Onepage</onepage>
      </rewrite>
    </checkout>
   </blocks>

In layout file:
 <checkout_onepage_progress>
        <reference name='root'>
            <action method='setTemplate'>
                <template>mymodule/checkout/onepage/progress.phtml</template>
            </action>
        </reference>
    </checkout_onepage_progress>

But $this object in progress.phtml is not referring to my module's block rather it is referring to core block. ie. I can't access method defined in my module's block class.

What should i write in config to override core block class.


texts:
cart().subtotal_excl_tax and cart().subtotal_incl_tax are the same
I got the some price. How can I get the subtotal with including tax?


texts:
I followed this tutorial to add a custom field to CMS pages:
https://www.atwix.com/magento/adding-custom-attribute-to-a-cms-page/

And it works very well. But I want an image uploader instead of a text field. How do I do this?

This is my Observer:

class test_CmsBanner_Model_Observer
{
    public function cmsField($observer)
    {
        //get CMS model with data
        $model = Mage::registry('cms_page');
        //get form instance
        $form = $observer->getForm();
        //create new custom fieldset 'test_content_fieldset'
        $fieldset = $form->addFieldset('test_content_fieldset', array('legend'=>Mage::helper('cms')->__('Custom'),'class'=>'fieldset-wide'));
        //add new field
        $fieldset->addField('content_custom', 'text', array(
            'name'      => 'content_custom',
            'label'     => Mage::helper('cms')->__('Banner Image'),
            'title'     => Mage::helper('cms')->__('Banner Image'),
            'disabled'  => false,
            //set field value
            'value'     => $model->getContentCustom()
        ));

    }
}

And I saw this line:

$fieldset->addField('content_custom', 'text', array(

It says text at the moment. What do I change it to, to create an image upload field?


texts: How to get subcategory product name in product view


texts: Drop Down Filter by Attribute in Products List toolbar

texts:
friends, I create custom pages for mobile Products list.
I added a filter in the form of drop down on the top toolbar, there is Filter by Category, Filter by Attribute and Sort By (Position, Name, Price, and Brand).
I've successful create a drop down Filter by Category and Sort by, and functioning properly.
I'm adding Filter by Category and Sort by in app\design\frontend\andi\phone\template\catalog\product\list\ctoolbar.phtml

Filter by Attribute, I have not managed to make his drop down.

Here's what I do to display the Filter by Attribute in toolbar :

Go into catalog.xml and in  delete left thing
Put this after the line with product_list name:

<block type="catalog/layer_view" name="filter_by_attributes" template="catalog/layer/view.phtml"/>

Then in list.phtml call :

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

My View.phtml to call the Filter Attribute (app\design\frontend\andi\phone\template\catalog\layer\view.phtml) :

<?php if($this->canShowBlock()): ?>
<?php echo $this->__('Filter') ?>
<div class="block-layered-nav">
<dl id="narrow-by-list">
    <?php $_filters = $this->getFilters() ?>
    <?php foreach ($_filters as $_filter): ?>
       <?php echo $_filter->setTitle($_filter->getName())->getHtml() ?>
    <?php endforeach; ?>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list')</script>

<script type="text/javascript">
   //<![CDATA[
     var _used_filter = [];
     <?php foreach ($_filters as $_filter): ?>
     _used_filter.push('<?php echo $_filter->getRequestVar() ?>');
     <?php endforeach; ?>
   //]]>
</script>
<?php endif; ?>

then the main question is how to make the dropdown Filter by Attribute based on catalog\layer\view.phtml?


texts: How to work on Sebwite/magento2-category-sidebar

texts: I had uploaded Sebwite/magento2-category-sidebar inside my root folder.I'm new to this topic.please share me that how can show the category sidebar in frontend.


texts:
Please anyone tell me how to link css files in magento 1?
I don't no where can I need to add the link ref file please tell me thanks...


texts: How to create a customer attribute with options on the fly

texts:
I want to create a custom customer attribute where for example he can complete custom values for

Complete your 5 best movies

Multiselect does not work because they need a source. There is something that I can create to save that custom data for example in a JSON or so?


texts:
I have been trying to solve the problem for several days.

I move whole working shop to VPS server. only the home page works,

http://b2b.nazwa.pl

when I click on the link I get error "not found".

also its not possible to run any command via SSH.

I install clean magento on the same server  and also I can not do any megento operation via SSH


texts:
I am using magento 2.1
In layered navigation, I want to display select all same as below screenshot.


texts: What is the use of the is_data_sharing field in eav_entity_type?

texts: I am looking in the Magento database structure and found the is_data_sharing field in the table eav_entity_type. I want to know what the use of this field is.


texts: What can be the security risks if files under var folder are publicly accessible?

texts:
I have a Magento live site on which following files are accessible from browser

   http://www.example.com/var/export/somefile.csv
       {somefile.csv file name may not be known publicly}
    http://www.example.com/var/log/exception.log
    http://www.example.com/var/log/system.log
    http://www.example.com/.gitignore

What kind of security related issues can arise because of these?
Can some one provide expert opinion?

Note:(Update) 1) Entire var folder is not publicly accessible, specific files are only accessible.

2) What if "somefile.csv" is a product feed file.


texts: Magento 2 : Set default image in image uploader field in system configuration

texts:
I want to set default image when user save configuration empty records.

  For eg : when user delete image and don't upload new image at that time, default image should be available in database/image uploader.

How to do that?

Any help would be appreciated.


texts: Requirejs-config.js not working for parent theme's responsive.js file

texts:
I would like to change the values for the media property for the files menu.js & responsive.js from media: '(min-width: 768px)' to media: '(min-width: 992px)'.

I thought using Magento's JS Mixin approach would be best as instead overriding these files entirly, with this approach I should be able to just change the media property.

So I created the requirejs-config.js file in my theme below, but it does't work.  It does not load the mixin files from my theme or give any errors in the browser console.

app/design/frontend/Namespace/mytheme/Magento_Theme/requirejs-config.js

"use strict";
var config = {
    config: {
        mixins: {
            'Magento_Theme/js/responsive': {
                'Magento_Theme/js/responsive-mixin': true
            },
            'lib/web/mage/menu': {
                'Magento_Theme/js/menu-mixin': true
            }
        }
    }
};

app/design/frontend/Namespace/mytheme/Magento_Theme/web/js/responsive-mixin.js

define([
    'jquery',
    'matchMedia',
    'mage/tabs',
    'domReady!'
], function ($, mediaCheck) {
    'use strict';

    var mixin = {

        media: '(min-width: 992px)'
    };

    return function (target) {
        return target.extend(mixin);
    };
});

I have cleared the cache and remove the static files.
i.e.

bin/magento cache:clean
rm -rf pub/static/frontend/ var/view_preprocessed/

I'm not sure what else to do?  Is it not possible to write a mixin for these files?  Is there another approach I can take. Ideally, I would prefer not to have to overide the files entirely in my theme.

UPDATE

I have noticed if I try to add a mixin for another file it works...
i.e.

"use strict";
var config = {
    config: {
        mixins: {
            'Magento_Ui/js/modal/confirm': {
                'Magento_Theme/js/test-mixin': true
            }
        }
    }
};

So is it that JS Mixins do not work for JS files which come from a parent theme or /lib directory?

Also, another way I can change the breakpoint in menu.js is to override the template in my theme and passing "mediaBreakpoint": "(max-width: 992px)" as one of the options

app/design/frontend/Namespace/mytheme/Magento_Theme/templates/html/topmenu.phtml

<?php $columnsLimit = $block->getColumnsLimit() ?: 0; ?>

<?php $_menu = $block->getHtml('level-top', 'submenu', $columnsLimit) ?>
<nav class="navigation" data-action="navigation">
    <ul data-mage-init='{"menu":{"mediaBreakpoint": "(max-width: 992px)", "responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'>
        <?= /* @escapeNotVerified */ $_menu ?>
        <?= /* @escapeNotVerified */ $block->getChildHtml() ?>
    </ul>
</nav>


texts:
I'm trying to install Magento older version but it gives an error like below if I install Magento 2 it doesn't give any error:

Error in file: "C:\xampp\htdocs\magento1\app\code\core\Mage\Dataflow\sql\dataflow_setup\install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'dataflow_session' already exists, query was: CREATE TABLE `dataflow_session` (
  `session_id` int NOT NULL auto_increment COMMENT 'Session Id' ,
  `user_id` int NOT NULL COMMENT 'User Id' ,
  `created_date` timestamp NULL default NULL COMMENT 'Created Date' ,
  `file` varchar(255) NULL COMMENT 'File' ,
  `type` varchar(32) NULL COMMENT 'Type' ,
  `direction` varchar(32) NULL COMMENT 'Direction' ,
  `comment` varchar(255) NULL COMMENT 'Comment' ,
  PRIMARY KEY (`session_id`)
) COMMENT='Dataflow Session' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci

Trace:
#0 C:\xampp\htdocs\magento1\app\code\core\Mage\Core\Model\Resource\Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 C:\xampp\htdocs\magento1\app\code\core\Mage\Core\Model\Resource\Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.0')
#2 C:\xampp\htdocs\magento1\app\code\core\Mage\Core\Model\Resource\Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.0')
#3 C:\xampp\htdocs\magento1\app\code\core\Mage\Core\Model\Resource\Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 C:\xampp\htdocs\magento1\app\code\core\Mage\Core\Model\App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 C:\xampp\htdocs\magento1\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Model_App->_initModules()
#6 C:\xampp\htdocs\magento1\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#7 C:\xampp\htdocs\magento1\index.php(83): Mage::run('', 'store')
#8 {main}


texts:
I have written a custom import script that reads data from CSV and creates/updates products in my store. The script is scheduled to be executed once per day (in the night) with the cron.
This is the cron configuration in the custom module that executes the import

<crontab>
        <jobs>
            <custom_import>
                <schedule>
                    <cron_expr>0 1 * * *</cron_expr>
                </schedule>
                <run>
                    <model>custom_import/observer::import</model>
                </run>
            </custom_import>
       </jobs>
</crontab>

The process takes a long time to execute (there are about 4000 products to process) and on the production server the max_execution_time is set to 30 (5 minutes) and I can not change it (set_time_limit does not work).

So I need to do the import in another way. I thought that the best way would be to have a 'trigger' script to be executed with cron. Then trigger script would start the import and before the time limit is reached re-run the import process.

I was wondering how this could be achieved in Magento or if there is a better way to do that.


texts: Remove flat rate shipping on orders above 1000$?

texts:
Is there any way to remove flat are shipping on orders, if their total is above 1000$?

I have to use flat rate on this site aswell, so I cant use the built in way of giving free shipping to orders, as it seems to apply only to normal shipping methods, and not flat rate.

Any help is more than welcome. Thank you!


texts: Magento 1.9 - How to show images label on product view page

texts:
I want to show product images label with each image on product view page.I found below code on product view page but it's not working.

<?php echo $this->htmlEscape($_product->getImageLabel())?>

I want to show label as caption with each image. Thanks


texts: Magento 1.9 Coupon code applied but subtotal, grand total and withdiscount totals not updating in quotes/carts

texts:
I m facing strange issue as follows:

I have created one shopping cart rule - with 10% on every product and to all customer groups.

Conditions and Actions applied for all the products.

When i add product to the cart/quote, an entry has been added to the quote  as per below:

Coupon_Code - SAMPLEFIRST10

TOTAL - $100.00

SUBTOTAL - $100.00

SUBTOTAL_WITHDISCOUNT - $100.00

GRANDTOTAL_WITHDISCOUNT - $100.00

So totals are not updating after applied discounts.

Checked few things so far such as tax module, rewrite promo cart rules, done reindex multiple times, no conflict found for promo cart rules but still no luck found.


texts:
Is it possible to share a customer's cart with different domains or substores?

If yes:

tell me what to use either domain or substore.
how to set this up

We have multiple domain names e.g. website1, website2, website3 and so on.

Scenario: if the customer adds a product to the cart from website1 and I also add a product from website2 both products should be displayed in the cart. If the customer decides to checkout on website2 the order should contain both products (from website1 and website2) but with the order id of website2.


texts: How can i display attribute on Detail tab?

texts:
I want to display my custom attribute on "Detail" Tab.
(now it display on "More information" tab)

Thanks !


texts: How to verify us zip code with region in checkout and my account address magento 2.3

texts:
I want to verify customer enter zip code is correctly match with the region.

For example:

zip code:10001

Region: New york

If the customer enters the wrong zip code for the region, it throws an error "your zipcode and region need to match"

I think I need to use the USPS API.

I created an account in USPS API.

How to implement this functionality in the checkout page and my account save address page.

I followed this below link. But It doesn't work for me.

https://www.w3solver.com/magento-2-address-verification-using-usps-api-on-checkout/

Any help, experience and knowledge sharing would be appreciated


texts: Error setting an adminhtml from a frontend path

texts:
I'm using a third-party which set an appendPaymentBlock Observer method

<adminhtml>
    <events>
        <payment_info_block_prepare_specific_information>
            <observers>
                <realex_payment_information>
                    <type>singleton</type>
                    <class>realex/observer</class>
                    <method>appendPaymentBlock</method>
                </realex_payment_information>
            </observers>
        </payment_info_block_prepare_specific_information>
        ...
    </events>
    ...
</adminhtml>

Basically, this method set a template:

public function appendPaymentBlock(Varien_Event_Observer $observer)
{
    ...

    $paymentInfoBlock
        ->setPayment($payment)
        ->setPaymentInfo($paymentData)
        ->setTemplate('realex/payment/info/payment-info.phtml');

    $block->append($paymentInfoBlock);
}

payment-info.phtml script is at  app/design/adminhtml/default/default/template/ path.

This is causing me the following critical error:

CRIT (2): Not valid template file:frontend/base/default/template/realex/payment/info/payment-info.phtml

How I can get this template from adminhtml and not from frontend folder?


texts:
I have a frontend form in my custom module. On submitting the form,I want to display the success message in a popup with some custom content. How is it possible? Please help.

This is my controller.

public function formAction()
{
    if ($this->getRequest()->getPost()){
    //My Action
    // Mage::getSingleton('core/session')->addSuccess('Your Request has been sent');
    $this->_redirect("*/");
}

This is my phtml

<form id="test_sample_form" method="post" action="<?php echo $this->getUrl('module/controller/action') ?>">
    <fieldset class="group-select">Test Fields</fieldset>
</form>

I want to display the success message in a popup. Please help.


texts: Magento 2: getting error for all pages We can't create the Wish List right now

texts:
php bin/magento setup:upgrade

 Undefined index: wishlist in /var/www/html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

display error on frontend

  We can't create the Wish List right now.


texts: Cleverly disable options 'cache' in Bundle View block

texts:
I have an interesting use case for disabling a Bundle's options 'cache':

Controller:

public function indexAction()
{
    Mage::register('my_flag',true);
    //...other stuff
}

app/code/local/MyCompany/MyModule/Block/Product/View/Type/Bundle.php:

#class rewrite of Mage_Bundle_Block_Catalog_Product_View_Type_Bundle
public function getOptions()
{
    if (!$this->_options || Mage::registry('my_flag')) { // this is the undesired hack
        $product = $this->getProduct();
        $typeInstance = $product->getTypeInstance(true);
        $typeInstance->setStoreFilter($product->getStoreId(), $product);

        $optionCollection = $typeInstance->getOptionsCollection($product);

        $selectionCollection = $typeInstance->getSelectionsCollection(
            $typeInstance->getOptionsIds($product),
            $product
        );

        $this->_options = $optionCollection->appendSelections($selectionCollection, false,
            Mage::helper('catalog/product')->getSkipSaleableCheck()
        );
    }

    return $this->_options;
}

Currently I'm rewriting this and requiring it to fetch/append from the collection if a Mage::registry value exists. This feels.... messy.

I'd love a clever solution that doesn't require me to set a Mage::registry value in the controller. I considered forcing the view to set $this->_options to null: but I'd rather the rewrite, quite honestly, than have that sort of logic in the view.

Edit:

From the same Bundle.php rewrite:

public function getProduct() {
    if (!$this->hasData('product') || Mage::registry('my_flag')) { // same hack
        $product = Mage::registry('product');
        if (is_null($product->getTypeInstance(true)->getStoreFilter($product))) {
            $product->getTypeInstance(true)->setStoreFilter(Mage::app()->getStore(), $product);
        }
        $this->setData('product', $product);
    }
    return $this->getData('product');
}


texts: Update additional_attributes for a product with catalogProductUpdate doesn't work

texts:
I am using Magento ver. 1.7.0.2

With catalogProductUpdate (SOAP V2) all fields are updated but only my optional attribute with name monitor2 does not updated with value vijf. I'd like to update my optional atrribute too.

Any idea what i am doing wrong?


texts: collectTotals() on quote does not update configurable product item price

texts:
I have a problem with tier prices and configurable products in magento2. In our solution the customer puts everything in their cart and then in the checkout they qualify for a customer group and through that also for a tier price.

This works very well with simple products. After they have qualified for the price i can make a get request for the rest api and get the totals with these prices updated from the backend. However, configurable products does not seem to update.

The code sets the customer group for the checkout/customer session and then runs collecttotals:

$this->_customerSession->setCustomerGroupId($level->getCustomerGroup());
$this->_checkoutSession->setCustomerData($customerInterface);
$quote->collectTotals()->save();

customerInterface object is initalized and has the same group id as mentioned in the code.

I find it very weird that the code acts so differently on a configured product as opposed to a simple one.

Any help would be appreciated.


texts: How to pass is_wishlist flag according to user is logged in or not in web api?

texts:
I am creating one API which gives me a product array But that API Is having  <resource ref="anonymous"/>.
And I want to pass the is_wishlist bool flag in the product array.
If the customer is logged in then that customer has some product in that wishlist so is_wishlist = 1 for only that one product.
I tried to do this way: but this is not working for guest users.
<route url="path" method="GET">
      <service class="path" method="home"/>
      <resources>
          <resource ref="anonymous"/>
      </resources>
      <data>
          <parameter name="customerId" force="true">%customer_id%</parameter>
      </data>
  </route>

Because in this we need to pass the auth token for the login user. so get data correctly with this but it is not working for the guest users because for the guest users we don't have any token.
So it gives an error : Required
Response :  {
"parameters" : {
"fieldName" : "customerId"
}
}
So guys please help me out of this.
Thank you in advance.


texts: How to check if the SEO company is making backlinks to our Magento store?

texts:
The SEO company suppose to be making "backlinks" to our Magento store. Is there any way for me to check these?

Thanks for any suggestions!


texts: need to add custom template file inside form container magento admin

texts:
What i have tried is the following.

I have a class which extends Mage_Adminhtml_Block_Widget_Form. Inside that i have the _prepareLayout function. Now i have set a block inside that function like this.

echo $this->getLayout()->createBlock('adminhtml/template')->setTemplate('path/tothefile.phtml')->toHtml();

Its working. But the issue is i have a javascript code inside this .phtml file and its running twice.

May be because of the core/text_list block type of widget instance or for the toHtml() . Do you guys have any idea whats wrong.


texts: How to add custom drop-down in admin product image section

texts:
I am trying to add a custom drop-down in Product edit page.
I want to add this drop-down in each image of the product.
Please see the following screenshot how I want to show the drop-down.

Can someone help and guide me how to achieve this functionality?
I found a phtml file where I can add a drop-down field but I need a help to store this value to each image.


texts: Magento | Which security patch can prevent spam customers to register and How to install it?

texts:
I need you to help me with Magento issue.

How to prevent spam customers to register which security patch we should install and How to install it?


texts: how can i change all urls of old website

texts: i just remove my website from hmsaver.com to homemarket.ae now every thing is working but i want to ask is that possible if any visitor came from google to hmsaver.com and he redirect with same url to https://www.hmsaver.com/electronics.html or any link of hmsaver.com to http://homemarket.ae/electronics.html


texts: Redirect nice urls to filtered urls (/products/attr/value -> /products.html?attr=valueid)

texts:
Normally attribute filters create links such as:

/products.html?brand=3

I'd like to have links such as this work:

/products/brand/MannCo

I don't want to hardcode these links and don't want the user to ever see the uglier link, so would the best solution be a custom module/controller? I'm having trouble figuring out how to setup the routing...


texts: Magento 2 how to add Materialize javascript in Magento 2?

texts:
I have tried to add materialize js to Magento 2 but it does not work. I have my materialize js in theme/web/js.

then I have the requirejs-config.js in theme/

this is the code:

var config = {

    // When load 'requirejs' always load the following files also
    deps: [
      "js/materialize"
    ]

  };

and I put my materialize.js inside this code:

   define([
      "jquery"
    ],
    function($) {


texts: Braintree payment returns "Unable to place order. Please try again later."

texts:
When I go to checkout I got this error (with Braintree Sandbox mode): "Unable to place order. Please try again later.".

I already did everything in https://github.com/magento/magento2/issues/5902, removed my SQL tables prefixes and so on.

Now, what's really strange to me is: I only get this error with some products.

Furthermore, my co-dev can't order anything at all!
So, what could be the problem? All products have same configuration.

Help, it's pretty urgent!


texts: How do I uninstall a module completely, with it's files and tables, in Magento 1.7.0.2, with an automated script?


texts: Selling Products by Linear Meter and Square Meter

texts:
Question: What is the best way to allow the user to purchase by linear meter?

Context: My company is putting together a basic Magento 2.2.2 store for a client (this is the first time we have worked with Magento). Our client needs to sell some products by linear meter and square meter. If I were building the site from the ground up, I'd be be putting in some kind of text box where the user could write a number, for example. This, however, is supposed to be a broadly "off the shelf" solution.

What I know: I have been doing some configuration with attribute sets and the like. However, nothing jumps out as immediately helpful.

What I suspect: You might tell me that the best way is to list each product as its own simple product and let the user select how many linear meters they want by changing the "Quantity" field of their order. It just doesn't feel very user friendly.

I hope that is clear and succinct.

Go easy on me, I'm new!

Mike


texts:
I've started getting this error when trying to Access Magento downloader, the rest of the site work:

  The PDO extension is required for this adapter but the extension is not loaded

Been searching for a fix, but didn't find one...

My php.ini at the bottom has everything that is suggested, it worked before... I don't know what happened..

I had complier enabled, then wanted to install a new extension, so disabled the complier and this happened.

Deleted everything manually form Cache folder and nothing.

I have this in the php.ini, any ideas?

extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so

Thanks,


texts: Magento CSS customization question by using gulp

texts:
I have issue getting gulp setup on my local DevOps
Can I just modify the scss file and modify the CSS manually?
Anything else I need to pay attention?


texts:
I need to know from where i can make changes in the time

In the picture shown above , you can see a  "clock" and "end in"

Need to know from where i can access the area in the backend

please help


texts:
I'm getting this odd error when I try to edit a customer
Not something I've come across before and don't even know what bakerloo_payment is. Thought it could it be something with Sage payments installation?

  Source model bakerloo_payment/source_paymentmethods not found for
  attribute bakerloo_payment_methods


texts: How to set product and category ID programmatically

texts:
We can set the category details i.e meta title,meta description as folllow

$category->setMetaTitle('meta title');
$category->setMetaDescription('meta description');
$category->setMetaKeyword('meta keywords')

Is it possible to set the category ID? also can we set the ID of product pro grammatically?  for example

$this->product->setStatus(1);
$this->product->setPrice('50');


texts: Add custom Select to contact form Magento 2 - Theme Luma

texts:
following other guides, I added in the page form to
/httpdocs/vendor/magento/module-contact/view/frontend/templates/form.phtml
and I added the code

        <?php /* @escapeNotVerified */ echo __('Come hai conosciuto AvaloItalia?') ?>

            <select selectname="selezione" id="selezione" title="<?php /* @escapeNotVerified */ echo __('Come hai conosciuto AvaloItalia?') ?>" data-validate="{required:true}" value="ciao">
              <option value="facebook">Facebook</option>
              <option value="google">Google</option>
              <option value="altro">Altro</option>
            </select>

I adjusted the template that I get email but the field is always empty.
{{trans "Name: %name" name=$data.name}}
{{trans "Email: %email" email=$data.email}}
{{trans "Phone Number: %telephone" telephone=$data.telephone}}
{{trans "Come hai conosciuto AvalonItalia?: %selezione" selezione=$data.selezione}}
{{trans "Comment: %comment" comment=$data.comment}}

What am I doing wrong? how can i fix it?


texts: How to use an accordion into another accordion ? (or tabs or collapse)

texts:
I'm trying to put an accordion into another,
and the lonely way I found is to not use the same widget into another.

Exemple,
the parent is an accordion,
the different children can be tabs.

The opposite works.

But, if i'm right,
I understood that it's not possible to use the same widget for the parent and the children.

My problem,
I have an accordion who has 4 forms,
each form as several tabs (if you select this, you have this input...)
AND I need to put another accordion or tab in the last tab.

What can I do ?


texts:
I need to change the URL of the shipping cost link:

Thought this can be done in the backend but i didn't find the option. Anyone know where to change it?


texts: filter product list follow condition in custom module magento 2

texts:
public function createCollection()
{
    /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
    $collection = $this->productCollectionFactory->create();

    if ($this->getData('store_id') !== null) {
        $collection->setStoreId($this->getData('store_id'));
    }

    $collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());

    $collection = $this->_addProductAttributesAndPrices($collection)
        ->addStoreFilter()
        ->addAttributeToSort('created_at', 'desc')
        ->setPageSize($this->getPageSize())
        ->setCurPage($this->getRequest()->getParam($this->getData('page_var_name'), 1));

    $conditions = $this->getConditions();
    $conditions->collectValidatedAttributes($collection);
    $this->sqlBuilder->attachConditionToCollection($collection, $conditions);

    /**
     * Prevent retrieval of duplicate records. This may occur when multiselect product attribute matches
     * several allowed values from condition simultaneously
     */
    $collection->distinct(true);

    return $collection;
}

/**
 * Get conditions
 *
 * @return \Magento\Rule\Model\Condition\Combine
 */
protected function getConditions()
{
    $conditions = $this->getData('conditions_encoded')
        ? $this->getData('conditions_encoded')
        : $this->getData('conditions');

    if ($conditions) {
        $conditions = $this->conditionsHelper->decode($conditions);
    }

    foreach ($conditions as $key => $condition) {
        if (!empty($condition['attribute'])
            && in_array($condition['attribute'], ['special_from_date', 'special_to_date'])
        ) {
            $conditions[$key]['value'] = date('Y-m-d H:i:s', strtotime($condition['value']));
        }
    }

    $this->rule->loadPost(['conditions' => $conditions]);
    return $this->rule->getConditions();
}

I found solution in core magento/catalogwidget/block/product. How do I filter product list follow condition in custom module.


texts: Magento 2 - include JS library without Require.JS

texts:
I'm trying to include the jsPDF library in my Magento 2 like this:

Hello, this is a H3 tag

A paragraph

    <button id="cmd">generate PDF</button>

The error message it returns is this:
require.min.js:16 Uncaught Error: Mismatched anonymous define() module: function(){"use strict";function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t)

Consequently the library doesn't work for me.
How can I properly include this JS library without using Require.js?


texts: Can a custom module have more than one namespace?

texts:
Is it fine to have more than one namespaces for a custom module? I haven't tried yet. But for some situations it's better if we can have this feature. Any suggestion will be appreciated.

Example:

Mynamespace1
      |
      --------Mynamespace2
                    |
                    --------------Mymodule
                                       |
                                       ---------Block
                                       |
                                       ---------Helper
                                       |
                                       ---------etc


texts: How do I add to wishlist programatically?

texts:
I have scoured the web yet I am no nearer to understanding how I add a product to the wishlist in code.

I have a product ID and a customer object in my controller and I just want to be able to add that product to that customer's wishlist. It is not rocket science I am after, just something that should be doable.


texts:
What do you use for Unit Testing in Magento? Or what do you know about Unit Testing and Magento? Whether you do TDD or you just want to have unit test coverage for your project components, you need some tools to do this.

The first basic approach is to use plain phpunit, but there are things that need additional gimmicks to make Magento "testable".

Everything I worked with is related to phpunit:

MTAF
EcomDev_PHPUnit (drawbacks: can't test emails)
TechDivision_MagentoUnitTesting (attempt to backport Magento 2 Unit Tests)
Mage-Test (lightweight unit testing for Magento)

Are there other options?


texts: Magento 2.2.7 single product image not showing on front end

texts:
I'm developing a website in Magento 2.2.7. I have a problem whereby if I only add one image to a product in the admin area it doesn't show on the frontend, even after trying all of the various settings for that particular image, e.g: adding Thumbnail, Swatch, Base etc, and the checkbox to hide from product page isn't checked so it's not that.

The area for the image to display is there, but it's empty.

I don't get any errors when uploading images, and once an additional 2nd or more images are added then all are displayed in a carousel on the frontend.

Any ideas why this could be?


texts:
I need to get bestsellers products for the current month. I use Magento\Sales\Model\ResourceModel\Report\Bestsellers\Collection, but I get bestsellers for all months, I used the following code to get it for current month

$collection = $this->productCollection->create('Magento\Sales\Model\ResourceModel\Report\Bestsellers\Collection');
$data=array();
    $collection->setPeriod('monthly');
    //$collection->setPeriod('year');

    $currentMonth = date('Y-m');
    foreach ($collection as $item) {
        if($item['period'] == $currentMonth){
            array_push($data,$item->getData());
        }

    }

but that code will take more time for every coming month.

Is there a way to get products of current month directly from database?


texts: External php file working in Magento1.9 but not in magento1.7

texts:
I have prepared a code which check product with no images and than add an image to it form a folder with same name as that of product. In Magento 1.9 it is working perfectly. But when i try it on magento1.7 it throughs fatal error.
Here is my code
 <?php
error_reporting(E_ALL | E_STRICT);
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
ini_set('memory_limit', '600M');
ini_set('max_execution_time', 1800);
umask(0);
Mage::app('admin');
$products_model =  Mage::getModel('catalog/product')
                ->getCollection()
                ->addAttributeToSelect('*')
                ->addAttributeToFilter('status', array("eq" => 1))
                ->load();
$backendModel = $products_model->getResource()->getAttribute('media_gallery')->getBackend();

foreach ($products_model as $pid){
    $img = pathinfo($pid->getImageUrl())['basename'];
     echo 'Name  =  '.$pid->getName().'
';
    echo 'Image  =  '.$img.'
';
    if($img =='' || $img== 'image.jpg'){
        //live
        $ImagePath = "/var/www/vhosts/inriverimage/pics/".$pid->getName().".jpg"; // path of the image

        //local
        //$ImagePath = dirname(__FILE__)."/media/import/".$pid->getName().".jpg"; // path of the image

        if(file_exists($ImagePath)){
            echo 'Image  Found
';
            $products_model = Mage::getModel('catalog/product')->load($pid->getId());
            $products_model->addImageToMediaGallery($ImagePath, array('image', 'small_image', 'thumbnail'), false);
            $products_model->save();
        }
        else{
            echo 'Image  Not found
';
        }
    }

}
?>

This code is working in Magento 1.9. But If i try run it in magento1.7
using following URL http://localhost/magento1.7/addimage.php it through following error
Fatal error: Uncaught exception 'Exception' with message 'Strict Notice: Declaration of Mage_Core_Controller_Request_Http::getBaseUrl() should be compatible with Zend_Controller_Request_Http::getBaseUrl($raw = false) in /var/www/vhosts/loruslive/httpdocs/app/code/core/Mage/Core/Controller/Request/Http.php on line 36' in /var/www/vhosts/loruslive/httpdocs/app/code/core/Mage/Core/functions.php:245 Stack trace: #0 /var/www/vhosts/loruslive/httpdocs/app/code/core/Mage/Core/Controller/Request/Http.php(36): mageCoreErrorHandler(2048, 'Declaration of ...', '/var/www/vhosts...', 36, Array) #1 /var/www/vhosts/loruslive/httpdocs/lib/Varien/Autoload.php(93): include('/var/www/vhosts...') #2 [internal function]: Varien_Autoload->autoload('Mage_Core_Contr...') #3 /var/www/vhosts/loruslive/httpdocs/app/code/core/Mage/Core/Model/App.php(1219): spl_autoload_call('Mage_Core_Contr...') #4 /var/www/vhosts/loruslive/httpdocs/app/code/core/Mage/Core/Model/Cookie.php(83): Mage_Core_Model_App->getRequest() #5 /var/www/vhosts/loruslive/httpdocs in /var/www/vhosts/loruslive/httpdocs/app/code/core/Mage/Core/functions.php on line 245


texts: Displaying Subcategory Blocks Magento 1.9.2

texts:
I'm having trouble displaying subcategory blocks in Magento. I have followed several solutions posted on here and this tutorial.

I created a static block with this code:

{{block type="catalog/navigation" template="catalog/navigation/subcategory_listing.phtml"}}

I also tried placing it in page/html/ as this was a solution I saw elsewhere.

Next I updated the settings on all top categories to:

Display mode: Static Block only

CMS Block: Sub Category Listing

Then I created the subcategory_listing.phtml file:

<?php
$_categories=$this->getCurrentChildCategories();
if($_categories->count()):
$categorycount = 0;
foreach ($_categories as $_category):
if($_category->getIsActive()):
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$catName = $this->getCurrentCategory()->getName();
if ($categorycount == 0){
$class = "first";
}
elseif ($categorycount == 3){
$class = "last";
}
else{
$class = "";
}
?>
<li class="item <?=$class?>">
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><img src="<?php echo $_category->getImageUrl() ?>" width="100" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" />

<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?>

<?php
endif;
if($categorycount == 3){
$categorycount = 0;
echo "
\n\n
";
}
else{
$categorycount++;
}
endforeach;
endif;
?>

and finally in app\code\local\Mage\Catalog\Block\Navigation.php I changed the getCurrentChildCategories() function to this:

public function getCurrentChildCategories()
   {
        $layer = Mage::getSingleton('catalog/layer');
        $category   = $layer->getCurrentCategory();
        /* @var $category Mage_Catalog_Model_Category */
        $collection = Mage::getModel('catalog/category')->getCollection();
        /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
        $collection->addAttributeToSelect('url_key')
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('is_anchor')
            ->addAttributeToSelect('image')
            ->addAttributeToFilter('is_active', 1)
            ->addIdFilter($category->getChildren())
            ->setOrder('position', 'ASC')
            ->joinUrlRewrite()
            ->load();

        $productCollection = Mage::getResourceModel('catalog/product_collection');
        $layer->prepareProductCollection($productCollection);
        $productCollection->addCountToCategories($collection);
        return $collection;
    }

This answer suggested it might be an issue with Magento caching static blocks, however disabling the cache on Blocks HTML makes no difference. Does anyone have a solution? is there an extension I can use instead?


texts:
i have problem i get error like this when i registration new user with  Duplicate email or id which is unique:
Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'asma@gmail.com' for key 'email' in C:\wamp64\www\ITaidLibrary-8\registration_page.php:20 Stack trace: #0 C:\wamp64\www\ITaidLibrary-8\registration_page.php(20): PDOStatement->execute(Array) #1 {main}thrown in C:\wamp64\www\ITaidLibrary-8\registration_page.php on line 20
i want to show message if it is already exist  how can i do it?
and thank you


texts:
Is there any way I can see and delete all pictures that are not in use in pub/media folder?
I found a couple of modules but all are just for deleted products and I want to include the ones at wysiwyg folder too, like from old homepages and pages that got new pictures. It would be painful and time consuming to go one by one checking if it is in use and delete by hand.
Thanks in advance :D
Best regards,
Rui Silva


texts: Magento 2.2.5 Add product custom fields in view page

texts:
In Magento 2.2.5, I need to achieve the following:
In product detail(view) page, I need to add the mandatory from date, to date and Comments fields. That should be added in the order Details and also in the custom table. How to achieve this.


texts: Magento after upgrading from 1.6 to 1.9,Google analytics report shows zero visitors

texts: i had updated my website from magento 1.6 to 1.9,and when i checked the google analytics report of our website for this month , it is showing 0 visitors.How could be it happen, did  i need to change any thing in the code


texts: Magento 2. Do I need custom code(e.g. Plugins) to trigger reindex logic for an Update on Save(realtime) configured Index?

texts:
My question is simple and straight forward.
Do I need to add custom logic to call my indexer(e.g. plugin on afterSave) when the indexer is configured as Update On Save or is Magento supposed to call it for me?

EDIT:

I'm adding a link to an issue that might suggest that UpdateOnSave does not work out of the box for custom indexers https://github.com/magento/magento2/issues/8866

Also if we take a look at \Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product::addCommitCallback Magento uses a plugin to add the reindexRow logic.


texts: India is select than state and city should be display

texts:
If user select "INDIA" country in billing step on checkout step
then indian state and city should be display in dropdown.

My default country is "USA"


texts: Add attribute column to admin product grid

texts:
I want to add a custom attribute to the Admin Product Grid.
The attribute got the attribute code import_price.

How can we add this column?


texts: M2: How to add a  tag on selected products?

texts:
I'm trying to add a <meta name="robots" content="noindex, nofollow" /> tag on selected products. In Magento 1, this is what the custom layout update on the product edit is for, so I could just reference head and use action to do that.
In Magento 2, however, it seems that I'm unable to do that. Although the same Custom Layout Update product attribute still exists in M2 and I can use referenceContainer, I'm unable to use referenceBlock, or <head>, so I don't really know how to proceed with this.

Any ideas would be greatly appreciated, I'd rather try avoid having to write a separate module just for achieving this goal if possible.


texts:
I have a custom option for a product. I would like to retrieve that data after add to cart is pressed but before the product is actually added to the cart.

I want the data '12345'.

I used the checkout_cart_add event observer but I can't get the product as a variable in the observer.php file because the product hasn't been added to the cart yet.

Custom option added from admin backend.

What event should I use? and what function to use to get this custom option data?

Any help would be appreciated.


texts: Custom option in product creation is not taking '0' as a value

texts: While creating products we have customizable options. After adding the option, in the add value field if I give 0(zero) its not taking.Giving Invalid option value error message.But its taking 00.How to solve this Magento bug.


texts:
We're trying to eliminate the entire process on making the build of JS and CSS.
What we exactly want is that we will create entire JS and CSS files manually and load them as a part of footer(No Magento process involvement) like we do in static websites. Is there any way we can stop Magento from even considering the JS and CSS files. All JS and CSS will not be even the part of build/deploy process and it will be served from CDN. We won't even have JS/CSS files in Magento folders.

Your help is much appreciated!

Thank you in advance.


texts: How to include CMS page in the phtml page in magento 2.2

texts: I want to include the CMS Page in a phtml template. How can I achieve this? Can anyone help me over here?


texts: magento 1.9 catalog price rules disappear in view page overnight

texts:
I am running Magento 1.9.3. I made a price rule to give all customer group 25% off on all products, and date is 7/25/2017 to 8/31/2017. I click the button "Save and Apply", the prices of all products run well.

But catalog price rules disappear in view page(Only view page) overnight.

I know this question already asked, for me catalog price rules working in list page but not working in view page.