texts:
I am getting errors while import products.

I have downloaded sample files and trying to upload the same on the website. But getting errors.

Invalid value for Attribute Set column (set doesn't exist?) in rows: 1, 2, 3, 4, 5, 6


texts: Group by products by attribute in minicart - Magento1.9

texts:
I want to know how to group by the products of a minicart by vendor_id attribute, evidently each product has this attribute vendor_id. Then I display at the header of each group the name of the vendor, i tried something but i need some group by. I have also some load in a foreach :/

checkout/cart/minicart.phtml:

 ...

    <?php $_items = $this->getRecentItems() ?>
         <?php if(count($_items)): ?>

                 <?php foreach($_items as $_item): ?>
                     <?php $vendor = Mage::getModel('udropship/vendor')->load( $_item->getUdropshipVendor(), 'vendor_id'); ?> //here i get a vendor id

                                         <?php echo $this->__('Vendeur : ') ?>
                                         <?php echo $this->__('Montant minimum de commande : ') ?>

                                         <?php echo $vendor->getVendorName() ?>	 //here i get a vendor name
                                         <?php echo $vendor->getMinimumOrderAmount().'&nbsp;'.'€' ?>	 //here i get another attribute

                     <?php echo $this->getItemHtml($_item) ?> //here we display all products
                 <?php endforeach; ?>

...

The result:

What i want:


texts: I upgraded from 2.1.9 to 2.2.7 but css and javascript is not working

texts:
I tried to upgrade using these commands :

composer require magento/product-community-edition 2.2.7 --no-update

composer update

rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

Everything ran successfully but css and javascript files are not working in the back- and front-end.
I checked the .httaccess files and ran content deploy:

php bin/magento setup:static-content:deploy ar_SA -f


texts: Magento CE 1.9.1 send newsletter to test email address

texts:
I am wanting to have the ability in the admin panel to send a newsletter to a test email address so I can see how it looks in different email clients. So I found a post that says to do the below. However my issue is it does not seem to work as once I add a newsletter to the queue I do not have any option to indicate it should go to a "test" email user.

the post I found said to
Go to /app/code/Mage/Newsletter/Model/Queue.php

Modify the method getSubscribersCollection() around line 126 to:

   $this->_subscribersCollection = Mage::getResourceModel('newsletter/subscriber_collection')
            ->addFieldToFilter('subscriber_email', 'your-test@email.com')
            ->useQueue($this);


texts:
I would like to change the text of my product file.

to change the text "19 pour inclut" with "tva inclue"

I tried to find the file in /app/design/frontend/default/your_theme/template/catalog/product/
but didn't find it

Pretty much like I tried to show on the pictures:

can somebody help?


texts: I'm installation magento 2 (Magento-CE-2.0.2) on local server

texts:
i mean on cpanel but facing this error, i did everything according to magento 2 installation requirement but at the end i don't know how to solve this error.

Starting Magento installation:
File permissions check...

Enabling Maintenance Mode...

Installing deployment configuration...


texts: Why is my theme not picked up? (and where to look to solve this)

texts:
I'm working with Magento a few now, but I encounter a problem that I can't solve. I installed a new template/theme and made the required changes to the Design > Package tab in the configuration of my site. Flushed caches, disabled all custom extensions but the template is not picked up.

Magento keeps falling back to the Base template files. So I tried to tell Magento to use the RWD template, again with no result at all.

I'm out of options now, really don't know if I'm overlooking something, or if there is another place to search for.

Is there anybody who can point me in the right direction? I'm using 1.9.3.1

Any help would be much appreciated!


texts: How to prevent Host Header Poisoning in Magento 2?

texts:
I'm using magento 2.4.1 , i tried to make a GET request, i added ':22345' as suffix in my host header so it will look like this:

when I invoke this code in phtml file
echo $block->getRequest()->getUriString();

it will print

https://xxxm2.com:22345/old-brand.html?brand_id=2&hdv9rom4p6=1

instead of

https://xxxm2.com/old-brand.html?brand_id=2&hdv9rom4p6=1

how can I fix this ?


texts: How do I change the password from admin_users in db using the salt?

texts:
I have a problem with the salt. My password looks like:

b59c9d784fad6053bc88d70babd68ec4:sTWR4rQKio6a03pt3in3JkhYN0b2AsBO

so I guess the salt is also encrypted. How do i get the salt value ?
There is another account which have this password:

0ae97fa8652ad8165ab28eb66255271c:rp

so if i change the password into another like this

myencryptedpassword:rp it works fine, but the first if i changed it like this:

myencryptedpassword:sTWR4rQKio6a03pt3in3JkhYN0b2AsBO it does not work. Why ? Thx in advance !

This is the magento version:

public static function getVersionInfo()
    {
        return array(
            'major'     => '1',
            'minor'     => '9',
            'revision'  => '2',
            'patch'     => '0',
            'stability' => '',
            'number'    => '',
        );
    }


texts: Get parent name of current category on category list pages in Magento 2

texts: I have found several methods of obtaining the product id of a category while on a category list page, but none covering the best way to obtain the parent name of the category while on a category page. Any help is appreciated.


texts:
In some EU countries, all discounts, including special prices, must be mentioned in invoice. But Magento doesn't display speciall price anywhere in orders. If speciall price is applied, it will display it just as regular price.

The below is an example of order. Actuall product price was 60€ and speciall price was applied. But it won't display this discount anywhere. Is there any simple solution to this problem? At least I would need it inside invoice.


texts: Get product - checkout/item price with product tax class ( Ignoring customer address tax )

texts:
I'm displaying the catalog prices with tax. Everything works great. Although i have setup different tax zones. Ex. outside EU 0 %.
When a user logins in and sets up an address outside EU i don't want the catalog price to change to the one with 0%. I want it to remain with the default tax class and recalculate it upon checkout.

Say we have a product with 24% tax class valued at 50$.
I want to continue showing 50$ until checkout where it'll include the tax zones checks and remove the tax due to the customer's address being outside EU.

Say in cart i can get the items price with

$this->helper('checkout')->getPriceInclTax($_item);

And the grand total

$quote = Mage::getModel('checkout/session')->getQuote();
$totals = $quote->getTotals();
$grandtotal = $totals["grand_total"]->getValue();

Any way i can get the grand total and the item price with Tax but strict keep the default tax class id that the product has ? And not get overriden by the customer tax class due to another tax zone ?

Thanks


texts: Magento 2: How to upload a banner slider on magento homepage?

texts: I have created the banner slider using HTML ,CSS and JS it has nothing related to magento but is a simple banner slider how do i put it on my magento homepage? Or How do i convert it to an magento extension?


texts: Magento 1.14 different websites / stores can't share a product url?

texts:
I'm in the process of an upgrade from 1.12 to 1.14 - I did an upgrade to 1.13 in between but read about a lot of issues with redirects.
I have got the site up to 1.14 without anything seemingly having issues except for the fact I still cannot get my product urls working correctly.
I have two sites, each with a product with the same name, each store needs the same slug for the product, but the domain name will change eg:

domain.co.uk/product
domain.com/product

However the second one even on a different store / website is getting '-1' added to the url, and I can't seem to clear them, as follows:

domain.co.uk/product
domain.com/product-1

I require these to be the same, but can't seem to get them to work (I've deleted a few of the Magento generated url rewrites but still bumps the user to the wrong url, which is not great for my SEO).
How do I get Magento to allow the same urls on different store levels and websites? Note, these are two different products on two different websites in the same installation, not the same product with different urls on different websites views. (Not the best set up I know...)


texts:
I am currently trying to get the Subtotal value with Magento 1.9.1.

Here is my code:

    <?php

    class AG_Fee_Model_Fee extends Varien_Object{

        public static function getFee(){

        $subtotal = Mage::helper('checkout')->formatPrice($this->getSubtotal());

            $feeAmt = $subtotal;

            return $feeAmt;

        }

        public static function canApply($address){

            $setFee = Mage::getStoreConfig('checkout/fee/active');

            if($setFee==1)

            {

                return true;

            }

        }

    }

I am calling the subtotal like this:
$subtotal = Mage::helper('checkout')->formatPrice($this->getSubtotal());
But it's giving me no result...

Where is the problem?

I'll be so gratefull to you if you can help me!

Thanks in advance!


texts: how to create or call block programmatically in magento2

texts:
i need to call top menu or header out ide the magento project in that case how to call it in magento2

in magento1.x we use

<?php

require_once(dirname(__FILE__).'/store/app/Mage.php');

$app = Mage::app();
$session = Mage::getSingleton('core/session', array('name'=>'frontend'));

$block = $app
    ->getLayout()
    ->getBlockSingleton('checkout/cart_sidebar')
    ->setTemplate('checkout/cart/sidebar.phtml');

echo $block->toHtml();

in magento2.0 how to do it?


texts: Backend: Form Contains Abstract Method -> Fatal Error

texts:
I'm getting following error when I acces my form:

Class MP_Search_Block_Adminhtml_Option_Edit_Tab_Form contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Mage_Adminhtml_Block_Widget_Tab_Interface::getTabLabel) in C:\xampp\apps\magento\htdocs\app\code\local\MP\Search\Block\Adminhtml\Option\Edit\Tab\Form.php on line 169

I already implemented Mage_Adminhtml_Block_Widget_Tab_Interface:

class MP_Search_Block_Adminhtml_Option_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface {
}

So what am I missing?


texts:
I want to "disable" frontend in Magento and use only admin interface. So every non-admin page should be redirect to /admin (/admin/dashboard)

I can't find way to do it.

.


texts:
I have get the new quote for every page reload in when the cart is empty.

If anyone face this issue....How to solve it.


texts: Magento 2 : Fetch customer Id from quote object

texts:
I have my Quote object, I just want to fetch customer id from it.

Here is how I loaded the quote object,

protected $quoteRepository;

public function __construct(
    ...
    \Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
    ....
) {
    ....
    $this->quoteRepository = $quoteRepository;
    ....
}

$quote = $this->quoteRepository->get($quoteId);


texts: Customize magento native captcha appearance. Change amount of lines and dots

texts: Hello AllI want to change the layout of my captcha on contact form. I need to decrease the amount of lines and dots it contains so, a user can see the text more clearly.Does anyone have any idea how to do it? Thanks in advance.


texts: How to Solve 502 Bad Gateway error in Nginx Magento 2?

texts:
I am getting the error code 502 Bad Gateway in my Magento Installation with the following error in error log

*1 upstream sent too big header while reading response header from upstream, client: 127.0.0.1, server: v3.com, request: "GET
/new-arrivals/ HTTP/1.1", upstream:
"fastcgi://unix:/run/php/php7.1-fpm.sock:", host: "v3.com"

How to solve this?


texts: How to Uniquely Determine the layout of a page

texts:
I've been building a module in which I need to know if a page has a unique layout.

My first thought was to get the list of layout handles and hash them. This works well for the most part, but doesn't take into account database layout updates.

My second thought was to hash the entire layout updates and use that. In principle, this works, but I think perhaps I am using the wrong function:

md5(Mage::app()->getLayout()->getUpdate()->asString());

This seems to get the same thing on every request. How do I just get the updates applied on a specific request? Is there a convenient function for that?

Or, is there a way to just get db updates? Something like

md5(implode($update->getHandles()) . $update->getAllDbLayoutUpdates());

would also be swell.

Looking at it from a different angle, is there such a method created already? Have I been looking at it all wrong?


texts: What's the difference between validate-phoneLax and validate-phoneStrict?

texts:
I tried using both and it seems they just validate the same way. And also, their validation codes are the same. Are there any difference between phoneStrict and phoneLax at all? Or you can just use either?
validate-phoneStrict
Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890
validate-phoneLax
Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890
This question applies to both M1 and M2.


texts: How to display the available sizes for configurable products with different attribute sets with different attribute code

texts:
I have two attribute sets say
i)Shirts
ii)Pants
The configurable product options are shirt_color/shirt_size pant_color/pant_size They have one thing in common.

How to display only the available sizes for each configurable product if available?
So far I tried..

               <?php /*?> <?php $cProduct = Mage::getModel('catalog/product')->load($_product->getId());
                //check if product is a configurable type or not
        if ($cProduct->getData('type_id') == "configurable")
        {
            //get the configurable data from the product
            $config = $cProduct->getTypeInstance(true);
            //loop through the attributes
            foreach($config->getConfigurableAttributesAsArray($cProduct) as $attributes)
            {
             echo count($attributes["values"])." availables";
                ?>
                            <div class="super_attribute[<?php echo                                                                                attributes['attribute_id'] ?>]" id="attribute<?php echo $attributes['attribute_id'] ?>">
                                <?php
                                foreach($attributes["values"] as $values)
                                {
                                    echo $values["label"];
                                }
                                ?>

                  <?php
            }
        }?><?php */?>

        <?php

         ?>

My output was
I need to fetch only the available sizes.. Need a solution...


texts:
Indian Rupee not display in pdf also My system Front end also I try some other system in frontend working but downloading Invoice pdfit shows &#8377;

I check all tutorial still same no changes. What is the problem?

app/etc/local.xml

<charset>utf8</charset>

app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php
$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/Rupee_Foradian.ttf');

I download Font and upload here lib/LinLibertineFont/Rupee_Foradian.ttf

Here what is the problem?


texts: Allowing access to index.php/customer/account/login with nginx

texts:
I am new to Magento and have setup a new instance manually. I can see the home page successfully but am unable to access
http://xyz/dev/index.php/customer/account/login/
and get a 404 error from nginx.

I have given access to all of dev folder by using this line in etc/nginx/sites-available/default:

location /dev/ {
        #       try_files $uri $uri/ /index.php$is_args$args;
        autoindex on;
        }

The commented line is what I have tried from another online document that did not work. How can I resolve this? I am doing this in incognito mode, if it helps.

P.S: How do I understand this URL structure? Looks new to me.


texts: Remove ONE of the checkboxes from the Gift Message on Order Level?

texts:
I enabled the Gift Messages on Order Level by going to System > Configuration > Sales > Sales > Gift Options. Now - the Gift message shows up on the delivery page during the checkout process but it requires (unnecessarily) the customer to click on two check-marks before they get to the actual text field to fill in the their gift message.

Is there a way to remove one of those checkmarks? I will never be using Gift messages on product level - just store level!

Thank you! :-*


texts: Magento 2: Setup Magento project after clone git repository

texts:
I want to set up a git project on my local machine.

I have successfully set up the database.

I have run git clone command and clone the project from git but some repository is blank.

so how can I set up a project in the localhost?

If anyone has a solution then provide

Any help would be appreciated.

Thanks in advance..!


texts: Extract total tax amount from Quote when using TaxJar

texts:
I have run into an issue with a Magento 1.9 instance that uses TaxJar. I am trying to extract the total tax on the Quote. With a standard Magento 1.9 instance, I can get the total tax as follows

$tax = $quote->getShippingAddress()->getTaxAmount()

With TaxJar installed, the above statement returns a null.

Is that expected?
What is the right way to extract tax from the Quote if the instance has TaxJar installed?

PS: I am a total noob in Magento (Less than 1 month of working on it). For most part, I have found solutions in stackexchange, so thank you all for that.


texts:
Magento2 custom product collection not filtering via color etc.. on listing page
Following is the code used
public function getClearProductCollection()
    {
        $categoryId = $this->getCategoryName(); // YOUR CATEGORY ID
        $category = $this->categoryFactory->create()->load($categoryId);
        $page=($this->getRequest()->getParam('p'))? $this->getRequest()->getParam('p') : 1;
        //get values of current limit
        $pageSize=($this->getRequest()->getParam('limit'))? $this->getRequest()->getParam('limit') : 2;
        $_productCollection = $category->getProductCollection()
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('online_discount',array('notnull' => true))
            ->setPageSize($pageSize)
            ->setCurPage($page);

        return $_productCollection;
    }


texts: IndexController: loadLayout() not working inside postAction() (Helper_Data not found)

texts:
I always get following error when calling $this->loadLayout() inside postAction() of my IndexController:

Fatal error: Class 'Mage_Package_MyModule_Helper_Data' not found in C:\xampp\apps\magento\htdocs\app\Mage.php on line 547

$this->renderLayout() doesn't give me an error.

IndexController:

class Package_MyModule_IndexController extends Mage_Core_Controller_Front_Action {

    public function indexAction() {
        $this->loadLayout();
        $this->renderLayout();
    }

    public function testAction() {
        $this->loadLayout();
        $this->renderLayout();
    }

    public function postAction() {
        $this->loadLayout();
        $this->renderLayout();
        //Mage_Core_Controller_Front_Action::loadLayout();
    }
}

I also tried to call the method directly out of the class Mage_Core_Controller_Front_Action but it still gives me the same error. indexAction() and testAction() do work as expected.

config.xml:

<config>
    <modules>
        <Package_MyModule>
            <version>0.3</version>
        </Package_MyModule>
    </modules>

    <frontend>

        <layout>
            <updates>
                <package_mymodule>
                    <file>mymodule.xml</file>
                </package_mymodule>
            </updates>
        </layout>

        <routers>
             <mymodule>
                <use>standard</use>
                  <args>
                     <module>Package_MyModule</module>
                     <frontName>mymodule</frontName>
                  </args>
             </mymodule>
        </routers>

    </frontend>

    <global>

        <models>
            <mymodule>
                <class>Package_MyModule_Model</class>
            </mymodule>
        </models>

        <helpers>
            <mymodule>
                <class>Package_MyModule_Helper</class>
            </mymodule>
        </helpers>

    </global>
</config>

app/code/local/Package/MyModule/Helper/Data.php:

class Package_MyModule_Helper_Data extends Mage_Core_Helper_Abstract {

}

/layout/mymodule.xml

<layout version="0.1.0">

    <mymodule_index_index>
        <reference name="content">
            <block type="core/template" name="default_mymodule_view" template="mymodule/view.phtml" />
        </reference>
    </mymodule_index_index>

</layout>

I think I got everything necessary at the right place. I have no idea why it isn't working inside postAction().


texts: Magento 2.2.6 : Shipment creation using REST API

texts:
Unable to create shipment in Magento 2.2.6

I am using the following source code like this in postman

  https://test.com/rest/V1/shipment

{ "entity" : { "order_id" : 70, "items" : [{ "order_item_id" : 94, "qty" : 1 } ], "tracks" : [{ "carrierCode" : "UPS", "order_id" : 70, "title" : "ground", "trackNumber" : "12345678", "parentId" : 1001 } ] } }

Thanks


texts: ERR_TOO_MANY_REDIRECTS error when setting up HTTPS

texts:
I have a simple website running Magento CE 1.9 on a single Linux/Apache server.
The website works ok with HTTP but I am having a lot of issues trying to get HTTPS working.

After setting the Unsecure and Secure Base URLS to https:// and saving the config, I immediately get logged out of the Admin console and get a ERR_TOO_MANY_REDIRECTS error. I have looked at and tried other similar posts people have made but nothing seems to fix it.

Current Magento settings:

AUTO REDIRCECT TO BASE URL = NO

USE WEB SERVER REWRITES = YES

USE SECURE URLS IN FRONTEND = YES

USE SECURE URLS IN ADMIN = YES

OFFLOADER HEADER = SSL OFFLOADED

I am not an experienced Magento or Web guy, so appreciate any guidance.

Thanks


texts: Magento 2 Frontend and Backend coming broken

texts:
I have successfully installed Magento 2 on my xampp. But when I'm trying to get into the Admin section or see the front-end, then it is coming broken.

I have tried to fix the path issue but its of no use. Dashboard section pretends to load and keeps so, but never loads. The css and js seem's to be broken for the backend and frontend section.


texts: Magento 2.3 The images not displayed in Gmail

texts:
i need your help i use the module from Mageplaza Smtp and the transactional emails not show the images in Gmail, but in outlook yes, i inspect the image code in base64 for the images is correctly displayed in both original emails.

the first image is in gmail and second in outlook
i don't know why only happen in gmail.


texts: Magento 2: XML before="-" and before="_"

texts:
I'm sure this is a very basic question but as the description is so generic, I'm having trouble researching it.

I've noticed in the layout XML files.

before="_" (before with underscore)
before="-" (before with dash)

Could someone explain what before does and what the result is with the dash or underscore?

Thank you


texts: Magento 2: customize price Configurable Product

texts:
I need to customize the price of my configurable product in order to show the donation on every purchase.
Basically I have a configurable product with size and color and instead of showing the regular price, I wanna show the real price subtracted the donation that we do.

Example: price = $120
I wanna show $110 + $10 donation. And of course I wanna show the same thing on the checkout page.

How can I do that?

Thanks and Happy new year!


texts: Magento 2: Remove coupon code from discount label

texts:
I want to remove Coupon code from Discount title on order summary from the Checkout page. please refer screenshot.

i have checked console:

            **Discount (test5)**
            test5

            -$8.56

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">
        <type name="Magento\SalesRule\Model\RulesApllier">
            <plugin name="vendor_onestepcheckout_salesrule" type="Vendor\Onepagecheckout\Model\RulesApllierPlugin" sortOrder="1"/>
        </type>
    </config>

    <?php
    namespace Vendor\Onepagecheckout\Model;

    class RulesApllierPlugin
    {
            public function afterAddDiscountDescription(
            \Magento\SalesRule\Model\RulesApplier $rulesApplier,
            callable $proceed,
            \Magento\Quote\Model\Quote\Address $address,
            \Magento\SalesRule\Model\Rule $rule
        ) {
            $description = $address->getDiscountDescriptionArray();
            $ruleLabel = $rule->getStoreLabel($address->getQuote()->getStore());
            $label = '';
            if ($ruleLabel) {
                $label = $ruleLabel;
            }
            //in original method, there was a piece of code here that added the coupon code to the discount
            if (strlen($label)) {
                $description[$rule->getId()] = $label;
            }
            $address->setDiscountDescriptionArray($description);
            return $rulesApplier;
        }

    }


texts: display "Additional information " below " Details" in product view page

texts:
please check the link :

http://hotwheelstoys.in/totaltoys2/var/www/html/totaltoys/happy-hours-scribblez.html

i want to display "additional information" below "Details"

this is view.phtml = > http://pasted.co/7bdb70a6

please help me to find solution


texts: Customer grid "last logged in" column not showing online users

texts:
In the customer grid, which is accessable through the main menu point Customers I have a user that has a blank last logged in column. When I look in the details off that user by clicking the edit link in the row I can clearly see, that the user has logged in AND is still online.

How can I show the last logged in date of online users in the grid?


texts: Creating configurable product but size attribute not available to choose in Step 1 of creating configurations

texts:
Hope you can help.

I've set up a size attribute in STORES > PRODUCT.

I've created a new attribute set in STORES > ATTRIBUTE SET and dragged the 'size' attribute into the middle column.

After doing this, I go to setup a new Configurable product.

I select Add Configurable Product.
Select the new attribute set from the drop down.
Enter the basic product details and click on the Create Configurations button.

In Step 1, only the color attribute is available for selection and I can't get the size attribute to appear.

I've tried changing the details in the size attribute to the same settings as in the color attribute but still no luck. Also changed to Global and has a greyed out 'multiple select' drop down.

Any ideas as to where I may be going wrong?


texts:
I was wondering would anybody be able to assist me.

I want to add a pop up on my magento 1 website that tells the user about our cookie policy.

I know there is a setting in magento already but it doesn’t look great on our website.

Has anyone implemented their own pop up message ?

And willing to give me some help or sample code ?

Thanks


texts: Load custom block with template file with PHP

texts:
I created a simple module, now I try to load the block with:

echo $this->getLayout()->createBlock('creation_newproducts/newproducts')->setTemplate('newproducts/newproduct.phtml')->toHtml();

I can echo content from block function however template file is not loaded.

<?xml version="1.0"?>
    <config>
        <modules>
            <Creation_Newproducts>
                <version>1.0.0</version>
            </Creation_Newproducts>
        </modules>
        <global>
            <blocks>
                <creation_newproducts>
                    <class>Creation_Newproducts_Block_Newproducts</class>
                </creation_newproducts>
            </blocks>
        </global>
    </config>

Template file:

app/design/frontend/default/mt_colinus/template/newproducts/newproducts.phtml

How can i echo the template file?

Is this even possible outside controller?


texts: How to bring all customer attributes on CatalogRule?

texts:
I have requirement to show all customer attributes on Catalog price Rule Form.
You can see attached image for more clarity.

How i can get customer attribute collection and how i can display in catalogrule section you can see in screen-shot.
Thanks In Advance


texts:
I want to override Magento\Catalog\Model\ResourceModel\Product\Collection using preference to modify the _buildClearSelect($select = null) method.

For this, I have created di.xml with the following code:

<?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\Catalog\Model\ResourceModel\Product\Collection" type="Vendor\ModuleName\Model\ResourceModel\Product\Collection" />
</config>

and Collection.php

namespace Vendor\ModuleName\Model\ResourceModel\Product;

class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
{
    /**
     * Build clear select
     *
     * @param \Magento\Framework\DB\Select $select
     * @return \Magento\Framework\DB\Select
     */
    protected function _buildClearSelect($select = null)
    {
        $select = parent::_buildClearSelect($select);
        $select->reset(\Magento\Framework\DB\Select::GROUP);
        return $select;
    }
}

Above code is not working. I have already tried to flush cache and remove the code directory from the generated directory.

Any help would be appreciated!


texts: M2.2 - Prevent Checkout if Specific Items not in Cart Together

texts:
We are looking for some form of way to handle a scenario like so;
Customer X has Item A, Item B and Item C-PART-1 in his cart. Due to having Item C-PART-1 in their cart and no inclusion of Item C-PART-2, they are prevented from checking out and placing their order.
However, Customer Y has Item B, Item C-PART-1 and Item C-PART-2 in his cart. Due to having the required two products together in the cart, they are able to move onto checkout and placing their order.
Is this possible? Via some form of seeing they only have one of the two requirements in their cart and alerting them to add the other, or possibly having one of the items being added to the cart automatically adds the other separate item?
Could be looked at as required to complete a bundle, or possibly accessory parts that would need to be purchased together. Thanks


texts: How to set require field to company in billing address in magento2?

texts: How to set require the field to a company in billing address in magento2?


texts: Proper Magento 2.1 Frontend develop flow

texts:
I am approaching Magento 2 for some projects and I am trying to setup an efficient workflow for frontend developing.
So far I followed this guide to setup a theme with a blank theme as a parent.
I also followed this other guide to setup Grunt.
As a bonus, i also reviewed all the steps and applied what was missing by following a third guide (bin/magento deploy:mode:set developer, static-deploy,...).

My problem is every time I edit my main less file I need to run a

grunt clean:theme && grunt exec:theme && grunt less:theme

Else I cannot see the edits when I refresh the page.
Grunt watch does not seem to help in the process, it does not update files at all. (Do I need to edit dev/tools/.../watch.js in some way?)
Running all three command slow down my process a lot, is there something I missed?

PS: Cache management is ON and Frontend development worflow is set to "Server side", on "Client side" I get strange CSS errors.


texts: Magento2.1 - Show custom category attribute on frontend

texts:
I added a custom category attribute via a module as this tutorial shows, that's working fine; the field is shown and saved correctly in the backend. But I can't figure out how to show it on the frontend.

I've added the attribute as a textfield, and it's content is supposed to be shown in a custom .phtml block that gets loaded on the category-view via XML.

I first tried to do it like you'd call a product attribute, i.e.

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_category = $block->getCategory();
echo $_category->getData('customcatattribute');

But no luck.

Then I found this answer and applied what it says, but still no luck.

Whenever I try to call the field I either get no results and the page works, or the page breaks and stays blank.

This shouldn't be too hard, how can I call my custom category attribute?


texts: Why Mage_CatalogIndex_Model_Aggregation is not caching layered navigation filters?

texts:
A question for an expert. Make sure you read the preamble - the question is at the bottom.

In app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php I noticed a functionality to cache _getItemsData output:

122         $key = $this->getLayer()->getStateKey().'_'.$this->_requestVar;
123         $data = $this->getLayer()->getAggregator()->getCacheData($key);

but it turns out $this->getLayer()->getAggregator() which is Mage_CatalogIndex_Model_Aggregation is turned off:

45 class Mage_CatalogIndex_Model_Aggregation extends Mage_Core_Model_Abstract
46 {
47     const CACHE_FLAG_NAME   = 'layered_navigation';
48
49     /**
50      * Initialize resource model
51      */
52     protected function _construct()
53     {
54         $this->_init('catalogindex/aggregation');
55     }
56
57     protected function _isEnabled()
58     {
59         return Mage::app()->useCache(self::CACHE_FLAG_NAME);
           #returns FALSE as there is no layered_navigation cache type
60     }

What is more interesting is that if I try to set return true; in _isEnabled function Magento complains that no catalogindex_aggregation DB table is found.

Of course it is not found because Magento team turned it off by placing this file app/code/core/Mage/CatalogIndex/sql/catalogindex_setup/install-1.6.0.0.php that does nothing:

 $installer = $this;
 /* @var $installer Mage_Core_Model_Resource_Setup */

 $installer->startSetup();

 $installer->endSetup();

That means a fresh Magento 1.9.3.0 install doesn't have all catalogindex_* tables which means Mage_CatalogIndex_Model_Aggregation won't cache attribute filter data.

Mage_CatalogIndex was supposed to cache layered_navigation data.

Why was it turned off by Magento team?

I also see that Mage_Catalog_Block_Layer_View is not cacheable. I wonder why Magento doesn't cache layered navigation at all. No wonder Magento has a reputation for being slow.

An insight from an expert would be appreciated.


texts: Magento 2 - Use Model Variable in Plugin

texts:
I'm looking for clarification on using a model variable within a plugin. I can't seem to find a concrete answer on how this is done, or if it's even possible.
A little background so we're on the same page. I have an integration with a local piece of software that sends product data to Magento 2 using the REST API. The module takes the information sent from the local software then translates the data so it creates and updates products, makes custom attributes and assigns values, along with sanitizing some data. That comes up as a JSON request.
What I'm looking to do is take the special price, price from/to dates and new from/to dates then work with them to extend what is done with those data points as they come in via plugin with beforeSave.
Is it easy enough to include a use statement that points to my model file? or is there more to it? The methods are public so it should be able to work with them I would think.


texts: How to define multiple routes in single module

texts:
I am defining two routes to be used in same module.

<router id="standard">
    <route frontName="hello" id="hello">
        <module name="HelloWorld_Hello"/>
    </route>
    <route frontName="blog" id="blog">
        <module name="HelloWorld_Hello"/>
    </route>
</router>

This is not working as expected.

I am expecting it to work like

websitename/hello
websitename/blog

I created Controller folder inside that created Blog and Index folder with Blog.php and Index.php with execute method.

Could you please tell me where is the problem?

Thanks


texts: Magento 2.2.0 Invalid Document Element 'resource': The attribute 'title' is required but missing

texts:
I am trying to upgrade a website from Magento 2.1.8 to 2.2.0

I have configured composer for 2.2.0 and also updated it with command line.

Now when I run magento setup:upgrade its halt on running schema and showing following note: pfa for more info.

  Running schema recurring...Invalid Document Element 'resource': The
  attribute 'title' is required but missing. Line: 12

  Element 'resource': The attribute 'title' is required but missing.
  Line: 13


texts: In Magento 2.3.4, Need to Merge CSS on Page wise

texts:
Many of them using Custom Theme with multiple custom modules.  In custom module, we calling particular module css on Layout xml file.

When we enable Merge CSS file option under admin -> Stores > Settings > Configuration > In the panel on the left under Advanced > choose Developer.

Currently, It merge all CSS in single file and loading the entire website. But, unwanted css (which not related to the page) also loading.

I am looking to merge the CSS on page wise and working on it. If anyone have an idea about this please comment it.


texts: Upgrading from 2.2.5 to 2.2.6 several problems encrypt key exceed 32 character and layout

texts:
I'm working on upgrading my store from 2.2.5 to 2.2.6
I'm following this with my cron jobs of

https://devdocs.magento.com/guides/v2.2/comp-mgr/cli/cli-upgrade.html

first problem arises at php bin/magento setup:upgrade
It says encrypt key can not exceed 32 characters.
when I count it is 32. By deleting a part of the key in app/etc/env.php
it seems to work but can i do this without consequence ?
QUESTION: can you just change or delete a big part of the key in app/etc/env.php without any consequence ??

It seems to work all but my layout is screwed. I did remove image cahce and run image resize command.
Ves image slider on my cms home page is not showing the whole image anymore and all products in my widgets on my cms home page are not following the grid template anymore ?? It seems like list template ?

The navigation menu now has some small squares in there

In a catagory in the storefront the products are showing with the footer color as background

Cookie notice has changed color and location form bottom to top.

And last below the copyright and all there is some customer account create stuff.

Did i do something wrong ?
can any one help me fix any of my issues ??


texts: Adding CSS to a block created in admin side in magento 2

texts:
I have created css to a block in magento 2 admin side. I want to add css to it .
Is there any standard way to do this beside using style tags?


texts: estimate-shipping-methods-by-address-id rest call return null in magento

texts:
I am working on to create a custom UPS Shipping method, I have integrated and get price from ups api and set shipping price. But, while click ship here the shipping method  loads, then hang the browser.

I checked browser network, it taks log time to load this rest call http://127.0.0.1/magento217/rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id and return null value in magento 2.

Its only happen Ups shipping is enable, other shipping methods fine.

Suggest Me, Why its take long time to load.

Note: I have disable Magento 2 default Ups Shipping method via config.php.


texts: Magento 1.9.1.0 - TypeError: this.toggleElements.toggleSingle is not a function

texts:
After installed Bannerslider.

Error: Uncaught TypeError: this.toggleElements.toggleSingle is not a function

app.js:1004

enquire.register('(max-width: ' + bp.medium + 'px)', {
    setup: function () {
        this.toggleElements = $j(
            // This selects the menu on the My Account and CMS pages
            '.col-left-first .block:not(.block-layered-nav) .block-title, ' +
                '.col-left-first .block-layered-nav .block-subtitle--filter, ' +
                '.sidebar:not(.col-left-first) .block .block-title'
        );
    },
    match: function () {
        this.toggleElements.toggleSingle();
    },
    unmatch: function () {
        this.toggleElements.toggleSingle({destruct: true});
    }
});


texts: Why am i getting "Payer Address Status: unconfirmed" on Paypal payment?

texts:
on each payment done with Paypal on Magento 1.8.0. i am getting Payer Address Status: unconfirmed on the Order details.

I think this is the main reason why i'm getting the Suspected Fraud status on each order too.

Any hint on why this is happening and why am i getting that the address status is unconfirmed? Thanks.

Edit: here is a transaction taken from the payment_paypal_standard.log i have just edited some values and changed it with * * variable_name * * for privacy reasons. If the variable has the same name in [request] and [ipn] means that their value is the same..for example * * magento_payer_email * * and * * paypal_payer_email * * are different.

2014-09-26T12:53:12+00:00 DEBUG (7): Array
(
    [request] => Array
        (
            [business] => ****
            [invoice] => 200000025
            [currency_code] => EUR
            [paymentaction] => sale
            [return] => https://5.144.161.214/it/paypal/standard/success/
            [cancel_return] => https://5.144.161.214/it/paypal/standard/cancel/
            [notify_url] => http://5.144.161.214/it/paypal/ipn/
            [bn] => Varien_Cart_WPS_US
            [item_name] => Artiglass
            [lc] => it_IT
            [charset] => utf-8
            [amount] => 1.00
            [tax] => 0.22
            [shipping] => 0.00
            [discount_amount] => 0.00
            [cmd] => _ext-enter
            [redirect_cmd] => _xclick
            [city] => ***city***
            [country] => IT
            [email] => ***magento_payer_email***
            [first_name] => yari
            [last_name] => ***surname***
            [zip] => 35036
            [state] => PD
            [address1] => ***address***
            [address2] =>
            [address_override] => 1
        )

    [__pid] => 8869
)

2014-09-26T12:54:13+00:00 DEBUG (7): Array
(
    [ipn] => Array
        (
            [address_city] => ***city***
            [address_country] => Italy
            [address_country_code] => IT
            [address_name] => yari ***surname***
            [address_state] => PD
            [address_status] => unconfirmed
            [address_street] => ***address***
            [address_zip] => 35036
            [business] => ***payment_reciever_email***
            [charset] => windows-1252
            [custom] =>
            [first_name] => Alessandro
            [handling_amount] => 0.00
            [invoice] => 200000025
            [ipn_track_id] => abeeab0b3ee4f
            [item_name] => Artiglass
            [item_number] =>
            [last_name] => ***paypal_payer_surname***
            [mc_currency] => EUR
            [mc_fee] => 0.39
            [mc_gross] => 1.22
            [notify_version] => 3.8
            [payer_email] => ***paypal_payer_email***
            [payer_id] => BUJ7BXSXRQ7PU
            [payer_status] => verified
            [payment_date] => 05:53:41 Sep 26, 2014 PDT
            [payment_fee] =>
            [payment_gross] =>
            [payment_status] => Completed
            [payment_type] => instant
            [protection_eligibility] => Eligible
            [quantity] => 1
            [receiver_email] => ***payment_reciever_email***
            [receiver_id] => C7TREZME4WYUA
            [residence_country] => IT
            [shipping] => 0.00
            [tax] => 0.00
            [transaction_subject] =>
            [txn_id] => 78772277D7485002W
            [txn_type] => web_accept
            [verify_sign] => APioMws2wuxbSdpVCGS5l5doAkp1AWHOvHSThPaCCSoI0oDj9cp0j..H
        )

    [postback_to] => https://www.paypal.com/cgi-bin/webscr
    [__pid] => 8872
)


texts: Magento 2 How to load product collection, Category collection, Load product by child ID

texts:
I have some experience in M1 and M2 but am somewhat struggling to grasp how to load the child category. At the minute it loads the default M2 category with [0] or [1] next category etc. But I just want to load the last category the product is attached too. Imagine Default > Electrics > Stereo > Cables. I just want to load the cables version, I know I could do it by doing [3] but imagine if another category only had Default > Electrics > Stereo it would then be [2] and I need that logic to be dynamic.

Pease can someone help, I've been crawling for hours and getting more and more confused.

This code relates to a custom related products module which is built to simply load products in the same last category view.

class Related extends Template
{
    protected $_productCollectionFactory;
    protected $_categoryFactory;
    protected $_registry;

public function __construct(
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    \Magento\Catalog\Model\CategoryFactory $categoryFactory,
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Catalog\Model\CategoryRepository $categoryRepository
)
{
    $this->_categoryFactory = $categoryFactory;
    $this->_productCollectionFactory = $productCollectionFactory;
    $this->_registry = $registry;
    $this->categoryRepository = $categoryRepository;
    parent::__construct($context);
}

public function getRelatedProducts()
{

    $categoryIds = $this->_registry->registry('current_product')->getCategoryIds();

    $category = $this->_categoryFactory->create()->load($categoryIds[0]);
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*')
        ->addCategoryFilter($category)
        ->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
        ->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
        ->setPageSize(5);
    return $collection;

}

}


texts: Increment/decrement buttons on category page without refeshing

texts: I want to add increment and decrement buttons for quantity on catalog page without refreshing the page Pease help!


texts: Adding new customer from backend not inserting store id

texts:
I am using magento 1.7.0.2.
I am having issue regarding store id.
When I add new customer from front end by sign up it adds store id in "Customer Entity" table.
But When I try to add customer from backend manually it doesn't insserts 'store id' in "Customer Entity" table.It inserss '0' when adding with admin.


texts: Countries in dropdown : 2 digits to 3 digits

texts:
I have a question about the source model "Country".

Currently, I can use, in my system.xml file, the following source_model :

<source_model>Magento\Directory\Model\Config\Source\Country</source_model>

In my Stores > Configuration, I can see my dropdown with the list of all countries.

But when I see the code, I can see my select option have only two digits as value, example :

<option value="AF">Afghanistan</option>

But I would like 3 digits, example :

<option value="AFG">Afghanistan</option>

Do you know how can I change that ? Did I need change the source model, or may be it's an option somewhere ?

Thanks !


texts: "Add to Cart" button on CMS Page - non product page

texts:
So, I am seeking a way to give my customers the ability to add a product to the Magento shopping cart directly from a standard non-product page (i.e. CMS).  I am using Community Edition 1.9 and from what I understand the ability to add a product to cart via URL (query string) was removed as of 1.3.

Is there any way to add this functionality?  I am not wanting the customer to have to click directly through to the Product page to place an order.  One less step I would think could help the friction and increase overall conversions.

Any one have an idea or suggestions?   Thanks in advance for any tips, tricks, solutions...


texts: Magento2, echo product attribute in minicart

texts:
How can I access product attribute to echo it in minicart    /web/template/minicart/item/default.html Like below works for cart page templates/cart/item/default.phtml

<?php
$product = $_item->getProduct();
$product_id = $product->getId();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id);
?>

...

echo $_product->getData('myattr')


texts:
I am trying to remove the cron jobs in Magento 2. In SSH running
crontab -l

I get the following output.

From Magento docs I found out that I need to run the command
php bin/magento cron:remove

to disable cron but it is not working. After running this command when I run "crontab -l" I still see the cron jobs code between #~ MAGENTO START and #~MAGENTO END.
I also checked the cron_schedule table to be sure If the cron was running and yes this table is still getting populated with new rows.
I have read somewhere that I need to remove cron only before uninstalling Magento but it is a staging environment and I do not need cron jobs here.
What I am doing wrong as I found this command in Magento docs to remove cron?


texts: How do I use and implement getModuleDir to echo view directory in template file?

texts:
I'd like to use getModuleDir to get my module's view directory and use it in my template file.
Which file do I add the getModuleDir function to, and how do I call this function in my template?

Vendor = Martens
Module = Showroom
Template = showroom.phtml

I have this code but do not know how to use or alter it...

class CustomModel
{
/**
 * @var \Magento\Framework\Module\Dir\Reader
 */
protected $moduleReader;

/**
 * @param \Magento\Framework\Module\Dir\Reader $moduleReader
 */
public function __construct(
    \Magento\Framework\Module\Dir\Reader $moduleReader
) {
    $this->moduleReader = $moduleReader;
}

public function getDirectory()
{
    $viewDir = $this->moduleReader->getModuleDir(
        \Magento\Framework\Module\Dir::MODULE_VIEW_DIR,
        'Vendor_Module'
    );
    return $viewDir . '/frontend/web/images';
}
}


texts: Magento 2 how to do multi sorting of product on product list page

texts:
In magento 2 by default we can sort product by product attribute, but we can do sorting with only one attribute at a time. I need to do sorting on multiple attributes.

If anyone know how can i achieve then please let me know.


texts: Magento2 : How to get value of checkbox in observer?

texts:
I will refer to previous post: Magento : How to get value of checkbox in observer?

Anyone have example of how to do the exact same for Magento 2?


texts: Magento2 extend a class from SalesRule module

texts:
I'm using magento 2.2 and I'm trying to extend a class, more exactly this one: \Magento\SalesRule\Model\Utility

And I'm facing an error:

Declaration of MagePal\CouponCodeExtraValidation\Model\SalesRule\ExtraValidation::canProcessRule(Magento\SalesRule\Model\Rule $rule, Magento\Quote\Model\Quote\Address $address) should be compatible with Magento\SalesRule\Model\Utility::canProcessRule($rule, $address) in /Applications/magento-2.2.1-1/apps/magento/htdocs/app/code/MagePal/CouponCodeExtraValidation/Model/SalesRule/ExtraValidation.php on line 0

This is how my class looks like:

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace MagePal\CouponCodeExtraValidation\Model\SalesRule;

class ExtraValidation extends \Magento\SalesRule\Model\Utility
{
    public function canProcessRule(
        \Magento\SalesRule\Model\Rule $rule,
        \Magento\Quote\Model\Quote\Address $address
    ){
        parent::canProcessRule($rule, $address);
    }
}

What am I doing wrong?

Thank you


texts: Email templates customization - header, footer + css

texts:
When I place an order, I'm receiving an email with the next content:

{{template config_path="design/email/header"}} {{inlinecss file="email-inline.css"}}

Thank you for your order from MYSITE.

Once your package ships we will send an email with a link to track your order. Your order summary is below. Thank you again for your business.

Your order #100000014
....
{{template config_path="design/email/footer"}}

I've created my email-inline.css in the folder skin/frontend/mysite/default/css but don't know what to do for showing the header/footer and apply that css.


texts: How to specify custom sort order for product collection?

texts:
I am trying to create a product collection based on array of products ids, and also sort the collection based on the ids array.

$productIds = array(318,310,311);
$collection = Mage::getModel('catalog/product')
        ->getCollection()
        ->setOrder('entity_id', 'asc') // This will not do the job
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('status', 1)
        ->addAttributeToFilter('entity_id', array(
    'in' => $productIds,
        ));

I want to sort collected as they appear in $productIds array that is 318, 310, 311 but above code will return collection sort like 310,311, 312.

Is this possible without using plain MySQL query as given below?

SELECT *
FROM catalog_product_entity
WHERE entity_id IN (318,
                    310,
                    311)
ORDER BY FIELD(entity_id, 318, 310, 311);


texts: authorize.net Direct Post hangs at "submitting order information", but takes money from customer

texts:
For PCI Compliance my client wants to change to Direct Post Method (DPM) for Authorize.net

I originally had an issue with it hanging on "submitting order information" with nothing happening, but I had compilation turned on, turning that off fixed the original issue

my current issue is that it hangs at "submitting order information" but it does process the order, takes the money, and sets the order status properly (pending) in the sites back end

I am getting no related errors in console, I cannot find any JavaScript error to cause this

It may just be taking so much longer than anticipated that we are closing, but we have waited 5+ minutes for this process to complete

Update

Got the following message posted to the payment page when it finally processed (had one running in the background while making my original post).  Again, the payment was captured successfully and the order in the sites back end was updated correctly

error:
An error occurred while trying to report this transaction to the merchant. An e-mail  has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.

Update 2

Authroize.net has confirmed the problem is a 'time out' while waiting on a response from my Magento site... I send original data to them, they send reply (Magento updates the back end, takes care of all that is necessary to mark order as processed, updates transaction id, etc), but we do not reply to them within 10 seconds.


texts: Magento 2: Create order from quote without quote submit

texts:
I want to create order from quote programmatically without submit quote.

Because if customer redirect to failure page then we have one button like Make payment which redirect to customer on checkout page and this we want all data which customer filled up last time.

Please help me how to create order from quote without submit quote programmatically?


texts: Caching issues on product and category updates using Redis and Varnish

texts:
For our shop with > 100.000 products and 2000 categories we use Redis as Magento Cache and Varnish on the load balancers as page cache. We have Magento 1.9.2x CE.

The main problem is that there is no connection between Magento and Varnish. On updating products or categories we have to invalidate Varnish manually.

What is a solutions for this?
My idea is to extend Magento caching mechanism to send a invalidation request to vanish for the relevant url(s).
But maybe there are ready solutions?

Can I be sure that Magento correctly invalidates its own cache (Redis in this case) ?

Should I give a try to full page cache extensions?
Which one?


texts:
I've this code in Magento:

<?php

    include_once('C:/xampp/htdocs/magento/app/Mage.php');

    Mage::app();
    $rootMagento = mage::getBaseDir();
    $files = scandir($rootMagento);
    $count = sizeof($files);
    for ($i =0; $i< $count; $i++) {
        if ($files[$i]=='productData.txt'){
            $fileAperto = fopen($files[$i], "r");
            $buffer = fread($fileAperto,filesize("productData.txt"));
            list($sku, $name, $description, $shortDescription, $price) = split("[\n]", $buffer);
            if ($sku == '' || $name == '' || $description == ''
                || $shortDescription == '' || $price == '') {
                mage::log('esportazione non corretta: manca uno dei dati');
            }
            fclose($fileAperto);
        }
    }

    //// prodotto ////

    $product_model = mage::getModel('catalog/product');

    $productId = $product_model->getIdBySku($sku);
    if (!$productId){
        //inserimento
        $productData = array ('sku' => $sku,
                              'name' => $name,
                              'description' => $description,
                              'short_description' => $shortDescription,
                              'status' => 0,
                              'visibility' => 0
                              );

        $product_model->setData($productData);
        try{
            $productId = $product_model->save()->getId();
            $product = $product_model->load($productId);
            $product->setQty($qty);
            $product->setIsInStock(1); //->isInStock(1)
            $product->save();
        }catch(Exception $e){
            mage::log($e->getMessage());
        }

    }else{
        //aggiornamento
        $product = $product_model->load($productId);
        // $productData... ... ..
        $product->setData($productData); // + codice x stock
    }

When I run it, I've this error:

  Integrity constraint violation: 1452 Cannot add or update a child row:
  a foreign key constraint fails (magento.catalog_product_entity,
  CONSTRAINT FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID
  FOREIGN KEY (attribute_set_id) REFERENCES eav_attribute_set
  (attribute_set_id) ON DE), query was: INSERT INTO
  catalog_product_entity (entity_type_id, sku, created_at,
  updated_at) VALUES (?, ?, '2016-08-24 16:15:22', '2016-08-24
  16:15:22')

Can you help me please?

Thank you very much!


texts: How to create endpoint for third party responses?

texts:
I would like to create a endpoint for third party where I gonna receive their response in XML format.
Example -
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <HPXML xmlns="http://OnlineStoreDealer.HirePurchase.schHP">
         <Line xmlns="">
            <LastName>Citizen</LastName>
            <FirstName>Jane</FirstName>
            <Email>jane@domain.co.nz</Email>
            <ApprovedAmount>1500.00</ApprovedAmount>
            <ApplicationNo>981234</ApplicationNo>
            <PurchaseReferenceNo>1234567890</PurchaseReferenceNo>
            <StartDate>20151223</StartDate>
            <Term>24</Term>
         </Line>
      </HPXML>
   </s:Body>
</s:Envelope>

In this response, I want to save application_no under sales_order table by using PurchaseReferenceNo as magento order number. I have already created a new column in order_sales table.
Also, I would like to display application_no under payment & shipping method of that perticular order detail. Please refer a image.

How can we achieve this?


texts: Magento Hacked: displays list of user emails and error message

texts:
-My client suspects his site was hacked,I'm not sure, but when I open index.php I get a list of emails and usernames, and what appears to be encrypted passwords (please correct me if I'm wrong).
I have drawn with red over the picture  to protect privacy (see the top, before the error message)

Q: Is this normal in Magento?
-The /admin folder is giving the same error.  I cant log into the admin, I got error 404 until I restored the htaccess file, now I have a error message same as the index.php of the homepage.
- I have found a file named config.php that when opened shows a form, to send something and inside I can read this in the first lines, it looks really suspicious.
<?php $bm_____s=base64_decode("ZXZhbChceDYyXHg2MVx4NzN ....

Q: Can anyone in the community confirm if this is a hacked site?
-The error log says that this is the problem:
"Mage registry key “controller” already exists"
Details:
a:5:{i:0;s:45:
"Mage registry key "controller" already exists"
;i:1;s:631:"
#0 /home/filomena/public_html/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /home/filomena/public_html/app/code/core/Mage/Core/Model/App.php(747): Mage::register('controller', Object(Mage_Core_Controller_Varien_Front))
#2 /home/filomena/public_html/app/code/core/Mage/Core/Model/App.php(1094): Mage_Core_Model_App->_initFrontController()
#3 /home/filomena/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->getFrontController()
#4 /home/filomena/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#5 /home/filomena/public_html/index.php(87): Mage::run('', 'store')
#6 {main}"
;s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Basically my main concern is if the site was hacked, how to backup and recover, is there any recommended guide / procedure to follow? thank you guys!
SOLUTION:
The site was effectively hacked, without the most recent security patches.
I have replaced all passwords, deleted suspicious users from the DB using phpmyadmin, scanned files, changed FTP passwords, done a fresh install of Magento via cpanel and then connected this new filesystem to the old DB after the cleanup. Installed all the latest patches and voila. it's running now.


texts:
How do I create a default category meta title for all the category pages?

I would like it to be something like this:

<title>{{category name}} - blah blah blah blah</title>

I want it to be the default only for category pages.

Is this possible?


texts:
In magento 2.2.2 I've created a Block called "Footer Links" and I've called the block from a my new widget called "footer links".

In the front end, the new links are appearing in a wrong place!!
How can I replace my new block with my themes footer_liks?
please, look at the picture attached

Beside, in my file structure I can see this file:

  app/design/frontend/swissup/argento-essence/Magento_Theme/layout/default.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="logo">
            <arguments>
                <argument name="logo_img_width" xsi:type="number">200</argument>
                <argument name="logo_img_height" xsi:type="number">64</argument>
            </arguments>
        </referenceBlock>
        <referenceContainer name="header-wrapper">
            <block class="Magento\Cms\Block\Block" name="header_cms_content">
                <arguments>
                    <argument name="block_id" xsi:type="string">header_cms_content</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="footer-toolbar-top">
            <block class="Magento\Cms\Block\Block" name="footer_social">
                <arguments>
                    <argument name="block_id" xsi:type="string">footer_social_icons</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="footer">
            <block class="Magento\Cms\Block\Block" name="footer_cms_content">
                <arguments>
                    <argument name="block_id" xsi:type="string">footer_cms_content</argument>
                </arguments>
            </block>
        </referenceContainer>
        <move element="form.subscribe" destination="footer-toolbar-top"/>
    </body>
</page>


texts:
Magento does not let you choose to export entity_id (among other system fields) in the dataflow wizard.

How to get around this ?

Trying to work this out I searched around, found some sites, but could not work it out.

Decided to work it out myself. The answer follows.


texts: Magento serialize grid input value save to custom module table

texts:
I have created serialize product grid for my custom module. When I select products I got this value in post 1=cG9zaXRpb249&2=cG9zaXRpb249.
How can I get only product ids from post value?


texts:
I want to retrieve all customer data including the address information, customer custom attributes, and customer profile information. Right now i'm using customer model like this:

$collections = Mage::getModel('customer/customer')->getCollection();
foreach ($collections as $collection) {
            $result[]= $collection->getData();
}
print_r($result);

form this i only get basic information like entity_id, store_id, created_at, is_active, and etc. by using this i can't get even the customer personal information like telephone or at least customer name


texts: Magento 2.3.4 how to Develop custom filter in left layered navigation?

texts:
I am developing a custom module to add the custom filter in left layered navigation,currently we have custom product collection and want to add the filter in layered navigation with three option:
1.All Product
2.Available Item
3.Sold Items

On forum I got some useful link
https://magento.stackexchange.com/a/103453/24878
and tried to add same as the described in this link but it seems this link is old and not working in current Magento version 2.3.4 .
If anyone work like this type of work please share me so I can implement in my code also.
Please share you ideas.
Thanks,


texts: How to get Image of Parent product for grouped child product in a template?

texts:
<img src="<?=$this->getImageUrl($item->getProduct(), 'image', 300) ?>" style="max-width: 15rem"/>

<a href="<?=$item->getProduct()->getProductUrl() ?>"><?php echo "Quantity : ".$item->getQty()?>
<?php echo $item->getName() ?>

  <?=$this->formatPrice($item->getPrice()) ?>

from the quote model.


texts: Magento 2.2 sidebar and additional sidebar issue

texts:
My Magento installation behaves weird. Sidebar main and sidebar additional do not display on the same level as column main as it should but Magento layout engine moves them under the column main. I tried everything and so far I do not know why.

Wrong layout

Correct layout

My corresponding layout xml is

    <body>
    <referenceContainer name="sidebar.main">
        <block class="Magento\Cms\Block\Block" name="sidebar-products" after="-">
            <arguments>
                <argument name="block_id" xsi:type="string">sidebar-products</argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceContainer name="sidebar.additional">
        <block class="Magento\Cms\Block\Block" name="sidebar-partners" after="-">
            <arguments>
                <argument name="block_id" xsi:type="string">sidebar-partners</argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceBlock name="view.addto.compare" remove="true"/>
    <move element="content.aside" destination="page.bottom.container" as="related_stuff"/>
    <move element="product.info" destination="content" after="product.info.media" />
    <move element="product.info.social" destination="product.info.options.wrapper.bottom" after="-" />
</body>

I have searched in my theme folder for layout updates or any files containing "sidebar" but nothing has come up.

Any ideas where I should check where the layout engine gets these wrong instructions?

Oh, And I also have tried with my own empty.xml but no success :(


texts: Inheriting CSS in child theme's child theme

texts:
I'm relatively new to this, so i hope someone can help me out.

In my store i have a child theme of blank. The changes in this child theme get properly displayed on the store front and everything not changed is inherited from blank (as it should be).

Now i need another child theme of this child theme to make some additional changes for specific sites in _theme.less. So i tried to create a child theme that inherits from my first child theme that inherits from blank.
But the  result is that it does not inherit the changes i made in _theme.less in the first child theme. New changes in _theme.less work but everything else is inherited from blank instead of the child theme of blank.

If i delete _theme.less in the child-child-theme it displays everything as changed in the first child theme. So i think the problem is that the new _theme.less overrides the _theme.less from it's parent completely. Shouldn't the child-child theme inherit everything from the child theme's _theme.less except when it is changed in it's own _theme.less?

Would be great if someone could show me a way out of this problem.


texts:
Only one of my Backend orders are not showing as shown in below pictures, Picture 1 is Normal Backend, with Picture 2 showing what I am seeing on only One Customers orders.

This is the First Time it's happened, nothing new has been installed, no updates, no Addons. It doesn't show the Order ID or anything.


texts: How to add the category with search bar in magento2?

texts:
How to add the categories drop down with title "All categories" attached with the search bar seen in the image attached here with in Magento2 ?

I just need to show the search bar with "All Categories" list.


texts: Magento 2.1 onepage checkout bug for every payment method a billing/shipping address

texts:
Maybe this is a bug in version 2.1

If I have e.g. 2 payment methods, after every payment method is the billing/shipping address shown (1 virtual item, so billing=shipping address).

So you would expect:

billing/shipping address
payment method 1
payment method 2

But I get:

payment method 1
billing/shipping address + order button
payment method 2
billing/shipping address + order button etc.

For other itemtypes the same situation, so payment method 1, billing address + order button, payment method 2, billing address + order button etc.

Any ideas ?


texts: How to add multiselect attribute to customer registration form?

texts: I want to add an attribute to admin registration form and to allow users to select multiple values. I can add a simple text field to the form but need help on how to add multi-select drop-down or check-boxes.


texts: Email validation in registration form to exclude example addresses

texts:
My current registration form only validates the proper input email format.
 Where my validation.js file has

['validate-email', 'Please enter a valid email address. For example johndoe@domain.com.', function (v) {
            //return Validation.get('IsEmpty').test(v) || /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(v)
            //return Validation.get('IsEmpty').test(v) || /^[\!\#$%\*/?|\^\{\}`~&\'\+\-=_a-z0-9][\!\#$%\*/?|\^\{\}`~&\'\+\-=_a-z0-9\.]{1,30}[\!\#$%\*/?|\^\{\}`~&\'\+\-=_a-z0-9]@([a-z0-9_-]{1,30}\.){1,5}[a-z]{2,4}$/i.test(v)
            return Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
        }],

What I want is my email to limit example email addresses such as test@test.com, email@domain.com, abc@abc.com etc also I want to limit the characters count to no more than 25 characters.


texts: What is the best way to create custom theme in magento 2.2?

texts:
Which files I should copied from the Luma theme to Custom theme?

When I create my custom theme - review section and add to cart in product view page are not working.

If I copies Magento_Review module review section will work.

but how to solve add to cart issue in product page?

Please anyone explain me what is the issue and solution?


texts:
My Magento 1.9.3 store is having problems on the Checkout page when a user is logged in. No problem with guest checkouts.

https://www.caferico.co.uk/checkout/onepage/

...I get a 500 Error which is difficult to debug. I cannot find any errors listed in /app/log/system.log or exception.log. Turning on Errors is also pointless as it doesn't get that far.

Does anyone know of a fix, or how I can debug the problem?

Thanks in advance

Kevin


texts: Magento 2: Add to Cart JS Override works on product page but not on category page

texts:
I override magento\vendor\magento\module-catalog\view\frontend\web\js\catalog-add-to-cart.js

as I need to change the text from "Add to Cart" to "Buy Now"

magento\app\code\Custom\Module\view\frontend\requirejs-config.js

var config = {
  "map": {
    "*": {
      "Magento_Catalog/js/catalog-add-to-cart": "Custom_Module/js/catalog-add-to-cart"
    }
  }
};

It works fine on Product Page, but on Category page it still goes to Main File not override file.

Why?


texts: Overwrite private method in LayoutProcessor?

texts:
In the LayoutProccesor.php I need to add two lines to the processPaymentConfiguration function. Now since this is a private function I can't write a plugin for it.

private function processPaymentConfiguration(array &$configuration, array $elements)
    {
        $output = [];
        foreach ($configuration as $paymentGroup => $groupConfig) {
            foreach ($groupConfig['methods'] as $paymentCode => $paymentComponent) {
                if (empty($paymentComponent['isBillingAddressRequired'])) {
                    continue;
                }
                $output[$paymentCode . '-form'] = $this->getBillingAddressComponent($paymentCode, $elements);

                // CUSTOMCODE
                unset($output[$paymentCode . '-form']['children']['form-fields']['children']['street']['label']);
               $output[$paymentCode . '-form']['children']['form-fields']['children']['street']['children']['0']['label'] = __('Address');
                // END OF CUSTOM CODE

            }
            unset($configuration[$paymentGroup]['methods']);
        }

        return $output;
    }

I rather not overwrite the LayoutProcessor all together since that might bring problems with other extensions?

I tried adding the two lines to an aroundProcess plugin since that is the only public function in the LayoutProcessor. But that didn't work. It is as if the private function is run after that around plugin? I also tried an after plugin without succes.

Any idea?

I'm trying to add the Address label to the street 0 while being in the checkout with a Downloadable product (so the checkout is a bit different).

I need to do this:

  $jsLayoutResult['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children']['renders']['children']['checkmo-form']['children']['form-fields']['children']['street']['children']['0']['label'] = __('Address');

I tried:

Adding it to an around plugin on process
Adding it to an after plugin on process

If i add it directly in the LayoutProcessor.php then the code works so the  lines of code are definitely correct. But since that is back practice it isn't an option.

Overwriting the whole LayoutProcessor is bad practice too since I'm creating a checkout and other extensions still need to work.

Any idea?


texts:
I am using Magento 2.0.4.

When I'm importing 2 test product thru csv file using the native magento importer , I have included one base image.

I thought Magento would create thumbnail and small image automatically. But in backend and front end thumbnail and small image are missing. Thus, I add the thumbnail and small image in small_image, small_image_label,thumbnail_image,thumbnail_image_label fields in my spreadsheet. But, the problem is thumbnail and small image also show up in product detail.

How can I eliminate thumbnail and small image in product detail?
As far as magento do it automatically to generate them, I have installed "GD" but still no hope.


texts:
I have a custom module 'banner' and in which I have added a button in its second tab(only two tabs for the module). when click on that button, it is submitting my banner automatically and then go to the grid page(i e it acts as just another save button). But the function of this button is to add an uploading image field.ie whenever the button is clicked, it should add an image form field to my tab file. This is my tab file.

<?php
    class Karaokeshop_Banner_Block_Adminhtml_Banner_Edit_Tab_Image extends Mage_Adminhtml_Block_Widget_Form
    {

        protected function _prepareForm()
        {
            $form = new Varien_Data_Form();
            $this->setForm($form);
            $fieldset = $form->addFieldset('banner_image', array('legend'=>Mage::helper('banner')->__('Banner Image')));
            //declaring a new custom form field and adding
            $fieldset->addType('add_button', 'Karaokeshop_Banner_Block_Adminhtml_Banner_Edit_Tab_Field_Custom');
            $fieldset->addField('banner_img_add_button', 'add_button', array(
                'title' => Mage::helper('banner')->__('Add Banner Image'),
                'id' => 'add_banner_img_button',
                'class' => 'scalable save',
                'style' => '',
                'onclick' => 'banner.add(this)',
                'type' => 'button',
            ));

             return parent::_prepareForm();
        }

}

this is my button defining file

<?php
    class Karaokeshop_Banner_Block_Adminhtml_Banner_Edit_Tab_Field_Custom extends Varien_Data_Form_Element_Abstract
    {
public function __construct($attributes=array())
{
    parent::__construct($attributes);
}
public function getElementHtml()
{
    $value = $this->getTitle();
    $onclick=$this->getOnclick();
    $class=$this->getClass();
    $id=$this->getId();
    $style=$this->getStyle();
    $type=$this->getType();
    $html='<button id="'.$id.'" class="'.$class.'" style="'.$style.'" onclick="'.$onclick.'" type="'.$type.'" title="'.$value.'">'.$value.' </button>';
    $html .= '<p id="' . $this->getHtmlId() . '"'. $this->serialize($this->getHtmlAttributes()) .'>
                <script type="text/javascript">
                //<![CDATA[

                    var banner =
                    {
                            add : function(obj)
                            {

                            },

                    };
                //]]>
                </script>
            </p>';
    return $html;
}
}

what should i do to change my button to an add button? what should I do to avoid this submitting functionality of the button. Please help me. Thanks in advance


texts: Magento 2.2: How to disable Attribute Set on product page

texts:
I have about 5000 types of attributes and when loading the product page it stays locked for 20 seconds.

How can I remove this field from the product page?


texts: HTTPS for all pages - how to do 301 redirect instead of 302?

texts:
We are redirecting all traffic on our Magento CE 1.7.0.2 site to HTTPS URL's by default. This is done by setting both the secure and unsecure base URL to https://domain.com.

We also have the "Auto-redirect to Base URL" set to No because having this option enabled (either 301 or 302) resulted in all requests for http://domain.com/product.html redirecting to the homepage (as per the accepted answer here). So we are forced to have the "Auto-redirect to Base URL" option disabled.

However, with the above setup Magento is doing a 302 redirect for all HTTP requests to the equivalent HTTPS URL. This is great for customers as it works seamlessly, but for search engines we would prefer a 301 redirect.

How can we have it do a 301 redirect instead of a 302 given the setup above?


texts: How to filter pending and processing orders at the same time

texts:
I want to be able to filter orders "pending" and "processing" at the same time (like the last option on the image).

How would I do that?


texts: Magento 2: Does magento 2 works without SQL triggers?

texts:
Here is the situation.

I am using magento 2.1.6 Enterprise edition. In magento documentation it has been said that "Magento uses MySQL database triggers to improve database access during reindexing".

But my question is what will happen if I use database without triggers. Because I am planning to move the database to Google cloud SQL. In google cloud documentation they said to avoid triggers if you are going to use replication as it may cause inconsistency in the replica.

What is the best is the best to go about it ?


texts: Not showing images on second frontend shop

texts:
We have 2 storeviews, everything is working fine on both storeviews except the product images on the second shop.

Main shop url: https://shop.diana-lys.aze.dk/default

Second shop url: https://shop.diana-lys.aze.dk/eur

On the backend the images are shown on both storeviews. And I have set the attributes as Global for all the images

On the main shop a image could be: https://shop.diana-lys.aze.dk/pub/media/catalog/product/cache/d80dba0dabe6c7def590d4d5d4c31073/2/2/22305084s_9.jpg

On the second shop, same product the image is: https://shop.diana-lys.aze.dk/pub/media/catalog/product/cache/201deb37a6bdbe2d27f8a762f254af4e/2/2/22305084s_9.jpg

It should be the same image. I am using Firebear to import the products from a CSV file. We are using the same template for both shops.

I have tried with deleting the var/cache - reindexing, clearing and flushing the cache.


texts: Magento 1.7.0.2 cannot login to admin locally

texts:
I installed locally magento 1.7.0.2 BUT i cannot login to admin panel!

WHAT TO DO?! I try absolutely everything solution in WEB!

I tried these suggested solutions

Clear the contents of the directory var/cache and try again.
still NO ADMIN LOGIN
I fixed it by manually setting two core_config_data values in the database.
They are as follows:

web/cookie/cookie_path = /

web/cookie/cookie_domain = "mydomain.com"
 still NO ADMIN LOGIN
I Opened Magento root directory and create tmp folder.
and Open “lib/Zend/Cache/Backend/File.php“,
and locate the following code:

protected $_options = array( ‘cache_dir’ => null, replace with protected $_options = array( ‘cache_dir’ => ‘tmp’,

still NO ADMIN LOGIN
I also checked my php.ini file there is upload_tmp_dir = "c:/wamp/tmp"
still NO ADMIN LOGIN

Whats wrong with local instalations of Magento guys ???

I still get the same admin page with a a url like this

http://magento1/index.php/admin/index/index/key/56d082fb6349c1a302a5afd93ed14e9d/


texts: How do I modify Magento rendered page before it's displayed?

texts:
I am trying to modify the rendered page content before it's displayed to the user. I would like to do this in my custom module.

So far, I have tried hooking into the cms_page_render event but:

it does not work for product pages
it doesn't hold the final HTML; it still has Magento templating tags

How do I go about modifying the rendered page content right before it's displayed to the user?


texts: In magento How to add any numbers of custom input field on product page front-end in 1.9.3

texts:
User can add any number of fields form frontend product view page.

There is a button to add more field. which user can add text and submit. Client wants to sale their mugs and each mug they want to save different message if they want.


texts: Magento2 Recent product view collection only cart page return any other page not return?

texts:
<?php
namespace Logicrays\ProductSlider\Block;

use Magento\Catalog\Block\Product\Context;
use Magento\Catalog\Model\Product\Visibility;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Framework\App\Http\Context as HttpContext;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\Reports\Block\Product\Viewed as ReportProductViewed;
use Logicrays\ProductSlider\Helper\Data;

class RecentProducts extends AbstractSlider
{
    protected $reportProductViewed;
    protected $recentlyViewed;
    protected $_layout;

    public function __construct(
        Context $context,
        CollectionFactory $productCollectionFactory,
        Visibility $catalogProductVisibility,
        DateTime $dateTime,
        Data $helperData,
        \Magento\Reports\Block\Product\Viewed $recentlyViewed,
        \Magento\Framework\View\LayoutInterface $layout,
        HttpContext $httpContext,
        ReportProductViewed $reportProductViewed,
        array $data = []
    ) {
        $this->reportProductViewed = $reportProductViewed;
        $this->recentlyViewed = $recentlyViewed;
        $this->_layout = $layout;

        parent::__construct($context, $productCollectionFactory, $catalogProductVisibility, $dateTime, $helperData, $httpContext, $data);
    }

    public function getProductCollection()
    {
        $collection = $this->reportProductViewed->getItemsCollection()->setPageSize($this->getProductsCount());
        //print_r($collection->getData());
        //exit;
        return $collection;
    }
}


texts:
Can anyone help with a design query, We currently developing a website using magento 1.9 and we have the basic category's across the top of the pages as standard, we are now looking to add a category box down the left side of every page but as well as keeping the top category box too. We have found code and addons but this seems to replace the top cat box with the side one and we would like to have both

Can anyone help with this issue?

Thank you.


texts: Is SCD_ON_DEMAND variable available for Magento 2 Open source version?

texts:
Can we configure global variable SCD_ON_DEMAND variable in env.php or somewhere else to mention about it for Magento 2 open source edition projects.

This SCD_ON_DEMAND variable is using in Magento 2.3 cloud setup. If its true then it will skips Static content deploy during build and deployment.

In Magento 2.2.x developer mode, SCD is not required at all but any settings or configuration available for open source edition so one can use for production mode also.

SCD - static content deploy


texts:
I would like to add a payment method for Magento 1.9 called Elavon. Elavon is a credit card processing feature/company that we are required to use. (this is Elavon's website: https://www.elavon.ca/). However unfortunately, Magento does not come with an Elavon Payment Method by default. I was looking at this before which is a Magento Elavon Extension: https://www.rootways.com/shop/magento-elavon-payment-module-extension however this Magento extension costs a high amount of money, and there is absolutely no way to get this Magento extension for free if at all possible. We are out of luck, because we cannot use the one that comes with Magento by default at all which is: Authorize.net.

Is there an alternative way on how to add the Elavon payment method to Magento? Any help would be appreciated. Thank you very much.


texts: Unable to place order on checkout page for configurable products magento 2.1.8

texts:
I am unable to place order on checkout page for configurable products in Magento 2.1.8.
It's working perfect for simple products.
At the same time i noticed that the quantity of configurable product is showing as zero even I change it.
Please help me to fix it.


texts:
Today I got this notification in Magento.

  New Patch for PayPal Instant Payment Notification (IPN) Changes.
  Upgrade to 1.9.3.3 or SUPEE-8167 by June 30, 2017 to Avoid Service
  Disruptions – 6/13/2017 As of June 30, 2017, PayPal Instant Payment
  Notifications will no longer allow you to use HTTP to post messages
  back to PayPal for verification. To comply with these changes, all
  merchants using PayPal must upgrade to Community Edition 1.9.3.3 or
  apply the SUPEE-8167 patch. Updates must be in place by June 30, 2017
  to avoid any service disruptions. The patch is available on the
  Community Edition Download Page
  (https://magento.com/tech-resources/download) and more information is
  available from PayPal at
  https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1916&viewlocale=en_US

The link https://magento.com/tech-resources/download does not provide me with a link to download Magento 1.9.3.3. I'm also unable to find a download link for or a guide to applying patch SUPEE-8167.

How can I avoid service disruptions caused by the PayPal Instant Payment Notification (IPN) Changes?


texts:
I have created a block of menu for my navigation:

        Home

        Products

If you can see there is link I have added for products page but I'm unsure what URL should I give in href="{{store url=""}}"

I have just default category and just wanted to display products on front end by clicking on products!


texts: Strange intermittent Paypal issue assigning old order numbers

texts:
This issue started 14 days ago for what we can see no apparent reason. When some customers choose to pay via PayPal (Express Checkout) they are able to pay, but the order is not created in Magento and PayPal has an old / already used invoice ID.

How can this happen? Thought it was impossible for magento to reissue Order / Invoice IDs


texts: How to bind event to custom admin button (help with architecture)

texts:
This is my first full Magento module so I'm in need of a fair amount of guidance. I've created a new admin page and I'm adding a custom button that will eventually trigger a database insert. For now I'm just trying to pass around a string. below is a description of what I have so far for this part of my project. I'm struggling with the flow and architecture that binds the different pieces.

I've stripped out unnecessary code for readability. Any help is greatly appreciated!

What I have so far

BLOCK: I defined a custom dispatch event (how do I bind this to button?)
TEMPLATE : has button with string value - choosing not to use layout.xml for the moment Edit : added onclick with controller as location
CONTROLLER: I'm struggling with this because my admin URL has a nonce key
OBSERVER: Can I use this to call my controller using the URL helper since I'm unable to access my controller directly? Or could I even just rely on the dispatcher to retrieve the word?

Myblock.php

<?php

class Mycompany_Mymodule_Block_Mymodule extends Mage_Core_Block_Template
{
  protected function _construct()
  {
        parent::_construct();
        $this->setTemplate('mymodule/mymodule.phtml');
    }

  protected function mymoduleButtonClick()
  {
        Mage::dispatchEvent('adminhtml_mymodule_onclick', array('word' => $myword));
  }

}

Template.phtml

<body>
 <?php
 $button = Mage::app()->getLayout()->createBlock('adminhtml/widget_button');
 $button->setData(array(
   'label' => $this->__('My Button'),
   'type' => 'submit',
   'class' => 'button',
   'value'   => 'string to be processed',
   'onclick' => "setLocation('{$this->getUrl('*/controller/action')}')"
   ));
 echo $button->toHtml();
 ?>    </body>

Config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <version>0.1.0</version>
        </Mycompany_Mymodule>
    </modules>
    <global>
    <events>
        <adminhtml_mymodule_onclick>
            <observers>
                <add_button_test>
                    <class>mymodule/observer</class>
                    <method>listen_for_button_click</method>
                </add_button_test>
            </observers>
        </adminhtml_mymodule_onclick>
    </events>
    </global>
    <admin>
        <routers>
                <mymodule>
                    <use>admin</use>
                    <args>
                        <module>Mycompany_Mymodule</module>
                        <frontName>mymodule</frontName>
                    </args>
                </mymodule>
            </routers>
        </admin>
</config>

AdminController.php

<?php
class Mycompany_Mymodule_AdminController extends Mage_Adminhtml_Controller_Action
{
    public function testAction()
    {
      // EXAMPLE ADMIN URL :
      // http://myurl/index.php/eventqueue/admin/index/key/cbccea8b07101bed49388ad190d4b14ed1b2df2c0491f3a2f52ed23a755f4af3/

      // The nonce key prevents me from using this action in the url without interference. Instead I'm redirected to the dashboard.

      // Others have mentioned the helper below. But I don't understand how to use it since I can get to this controller successfully.
      //Mage::helper('adminhtml')->getUrl('adminhtml/Mycompany_Mymodule/index');
    }
}

Observer.php

<?php
class Mycompany_Mymodule_Model_Observer
{
    public function listen_for_button_click($observer)
    {
        // $word_from_button = $observer->?????;
        // is ' $observer->' holding data defined in dispatch example: $observer->word
        Mage::log('observer test!', null, 'lindsaylog.log');
    }
}
 ?>


texts: How can i change isActive from database for disable categories

texts:
How can i change categories status isActive from yes to no, from my magento admin panel it takes too much of time to disable categories, how to disable from database.

.


texts: net::ERR_ABORTED 403 (Forbidden) at frontend

texts:
I have created store view in French and German language, i have installed both language package and deployed it, but when I change the store language from the frontend, language is changed but in console, it give many errors,
like below image,

I'm using ubuntu XAMPP


texts: My Magento store Warnings and Error messages for users are displaying on wrong pages

texts:
I've got a magento store that is working perfectly fine. But the only issue is that Error messages are not displaying where they suppose to be displayed.

For example the message displayed on the screenshot was supposed to be displayed on the onestepcheckout. But instead it is displayed on the homepage.

the main message that i'm concern with is the vat id error message:

on core i have found the public function of one of the messages that i want to place on a right page. currently the message "The VAT ID entered (%s) is not a valid VAT ID" is displayed on a wrong page. it suppose to display on onestepcheckout page:

public function getVatValidationUserMessage($customerAddress, $customerGroupAutoAssignDisabled, $validationResult)
{
    $message = '';
    $isError = true;
    $customerVatClass = $this->getCustomerVatClass($customerAddress->getCountryId(), $validationResult);
    $groupAutoAssignDisabled = Mage::getStoreConfigFlag(self::XML_PATH_CUSTOMER_VIV_GROUP_AUTO_ASSIGN);

    $willChargeTaxMessage    = $this->__('You will be charged tax.');
    $willNotChargeTaxMessage = $this->__('You will not be charged tax.');

    if ($validationResult->getIsValid()) {
        $message = $this->__('Your VAT ID was successfully validated.');
        $isError = false;

        if (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled) {
            $message .= ' ' . ($customerVatClass == self::VAT_CLASS_DOMESTIC
                ? $willChargeTaxMessage
                : $willNotChargeTaxMessage);
        }
    } else if ($validationResult->getRequestSuccess()) {
        $message = sprintf(
            $this->__('The VAT ID entered (%s) is not a valid VAT ID.') . ' ',
            $this->escapeHtml($customerAddress->getVatId())
        );
        if (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled) {
            $message .= $willChargeTaxMessage;
        }
    }
    else {
        $contactUsMessage = sprintf($this->__('If you believe this is an error, please contact us at %s'),
            Mage::getStoreConfig(self::XML_PATH_SUPPORT_EMAIL));

        $message = $this->__('Your Tax ID cannot be validated.') . ' '
            . (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled
                ? $willChargeTaxMessage . ' ' : '')
            . $contactUsMessage;
    }

    $validationMessageEnvelope = new Varien_Object();
    $validationMessageEnvelope->setMessage($message);
    $validationMessageEnvelope->setIsError($isError);

    return $validationMessageEnvelope;
}


texts:
I have a magento store running 1.9.3.6 and I cannot get a shopping cart price rule to work. Essentially, I want 4 items from a particular category with 3 attributes to be discounted to £10 from full price of £15.96 if 4 of the specific items are added to my cart.

Currently I have:

CONDITIONS:
Apply the rule only if the following conditions are met (leave blank for all products)If ALL  of these conditions are TRUE :

If an item is FOUND  in the cart with ALL  of these conditions true:

Category  is  30
Bottle Size  is  10ml
VG/PG Mix  is  50/50
Quantity in cart  is  4

ACTIONS:
Update prices using the following information
Apply Fixed Amount Discount for whole cart

Discount Amount 5.96
Maximum Qty Discount is Applied To (blank)

I have saved the rule.

Now when I add 4 of the specific items which match the above conditions to my cart the amount still shows as £15.96.

Any ideas as to where I am going wrong as this is killing me... any input is appreciated.


texts: Clear GRID Serializer Values in hidden field

texts:
I have a working Grid Serializer. Now I want to clear the Grid Serializer values without refreshing page. So, I added a jquery script to clear the hidden field:

$("input[name='links[products]']").prop("value", "");

It works fine when I am on the first page, but when I go to the next page and clear the hidden Grid Serializer it will not clear for the previous page.

I can able to see that the Grid Serializer hidden field was empty, but when I tried to do a search or reset filter the hidden values are posted in the form data.

I don't know how the post values are posted even the hidden field was empty. Is there any way to clear the Grid Serializer values?