texts: Product page (Does not show a category when displayed on homepage)

texts:
When i list my products on front page (from Default Category (Father of all other categories anchor is set YES)), when click in any product, the product page (product view) doesn't show the category of this product.

Category of product doesn't show in Breadcumb and URL
My product is acessible via direct link, like this:
mystore.com/product-name, when i see on list of category page, the url is mystore.com/category/product-name, i want force always show the category of this product.

Note: Magento 1.9.2.4

What i need do?

Thanks!


texts:
How Do I Get Rid Of Code Showing Up After the Paypal Express Button on the Product Page?

I've attached an image of the problem.

I'm using Magento vers. 1.9.


texts: requirejs ! bootstrap.min is not loading in Magento2

texts:
I am doing theme integretion. I have included the bootstrap.min.js file in requirejs-config.js

in requirejs-config.js file

 var config = {

 map: {
    '*': {
        'jqueryjs': 'India_Newtheme/js/jquery',
        'bootstrapmin': 'India_Newtheme/js/vendor/bootstrap.min',
        //'bootstrapselect_min': 'India_Newtheme/js/bootstrap-select.min',
        'scripts': 'India_Newtheme/js/scripts',
        //'jquery_dtpicker': 'India_Newtheme/js/jquery.simple-dtpicker',
        //'jquery_wizard': 'India_Newtheme/js/jquery.smartWizard',
        'html5shivmin': 'India_Newtheme/js/html5shiv.min',
       // 'scripts1': 'India_Newtheme/js/scripts1'
    }
},
paths: {
        'jqueryjs': 'India_Newtheme/js/jquery',
        'bootstrapmin': 'India_Newtheme/js/vendor/bootstrap.min',
        'scripts': 'India_Newtheme/js/scripts',
        //'jquery_dtpicker': 'India_Newtheme/js/jquery.simple-dtpicker',
       // 'jquery_wizard': 'India_Newtheme/js/jquery.smartWizard',
        'html5shivmin': 'India_Newtheme/js/html5shiv.min',
       // 'scripts1': 'India_Newtheme/js/scripts1',
       // 'priceform': 'India_Newtheme/js/priceForm',
        'animated': 'India_Newtheme/js/animated'
},
shim: {

'jqueryjs': {
    deps: ['jquery']
},

'bootstrapmin': {
    deps: ['jquery']
},

/*'bootstrapselect_min': {
    deps: ['jquery']
},

'jquery_wizard': {
    deps: ['jquery']
},
'jquery_dtpicker': {
    deps: ['jquery']
},
*/
'scripts': {
    deps: ['jquery']
},

'html5shivmin': {
    deps: ['jquery']
},
/*'scripts1': {
    deps: ['jquery']
},
'priceform':{
    deps: ['jquery']
},*/
'animated':{
    deps: ['jquery']
}}}

It is not taking the bootstrap.min file and any other js file at all.How to integrate external js with Magento theme.Kindly help me on this


texts: Magento 2: How to send data using Ajax form in custom form?

texts:
Can anyone explain me how I can create a simple form on Magento-2 page to send data using Ajax?
I already have a form and controller action, that send data without using ajax.


texts: Magento 2: Can't delete additional address from address book

texts:
When I am going to delete an address from "My Account" address book I am getting error message We can't delete the address right now.

But some other account I can delete the address.

I have checked controller file or delete the address and it's giving an error from the catch.

if ($addressId && $this->_formKeyValidator->validate($this->getRequest())) {
        try {
            $address = $this->_addressRepository->getById($addressId);
            if ($address->getCustomerId() === $this->_getSession()->getCustomerId()) {
                $this->_addressRepository->deleteById($addressId);
                $this->messageManager->addSuccess(__('You deleted the address.'));
            } else {
                $this->messageManager->addError(__('We can\'t delete the address right now.'));
            }
        } catch (\Exception $other) {
            $this->messageManager->addException($other, __('We can\'t delete the address right now.'));
        }
    }

Also in the system log, it's give an error like main.CRITICAL: Exception message: "Street Address" cannot contain more than 1 lines.

Please help me to solve this issue.


texts:
Get the response from rest API. after that how to place an order based on success or failure messages. If success then only place an order else show the failure message on the checkout page.

try {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $service_url);
            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
            curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            $response = curl_exec($ch);
            echo $response;
        }

Can you please any one help me.


texts:
I am a web admin for a retailer and don't have access to the code for our Magento site, so I am hoping the fix to this issue is something done through the admin login. And please bear with my lack of technical knowledge!

A custom attribute used on the front end (brand name) does not save when editing individual products. We have found around 75% of our products, bulk imported from a CSV file, have not 'kept' the brand name from that import file.

When trying to edit these products individually, the 'brand name' dropdown value does not always get saved (sometimes it does, mostly it doesn't). The only way of reliably getting this attribute to save is to use the bulk 'Update Attributes' option, which is impractical.

Is anyone able to explain this, and/or offer a fix suggestion? It's a vitally important attribute from a user point of view, so people can filter by brand.

Cheers,

Hayden


texts: How to add sub menu items - more than one child in one parent for menu item?

texts:
I have a custom menu on the dashboard, and I need to group the items through the parent item in the menu, as shown in the attach. Thanks

My custom menu.


texts: How to move all my root categories and subcategories in to one single root category

texts:
I use Magento 1.8.1 i created an online store with around 8 root categories and (8-12) sub-categories under each root category now my client wants to create a new root category namely products and move all the root categories and sub-categories in to the newly created category.

As I am new to Magento i do know whether this is achievable or will i face any drawbacks by changing the root categories and sub-categories as category ID's and URL will be affected.

If it is recommended and achievable how can i do it or should i do a fresh start.

Thanks in advance.


texts: Add new field in magento(1.9) customer registration

texts:
I like to add new field in customer registration and admin customer creation form.

The field name is license number. I searched so many links related to my requirement but those do not work in Magento (1.9). Even I found the extension related to this:

http://www.magentocommerce.com/magento-connect/custome-account-profile-13594.html

When I installed the above extension using key, it shows an error.
Can you please give some idea related to my requirement?


texts:
We have just noticed yesterday that sometimes we see a "not ...." when you are logged into magento. This is different to the "welcome ..." you see when you are logged in. This "not ..." is a link and links to "/persistent/index/unsetCookie". When I click on this link it ends up taking me to my account page.

Why is this "not ...?" showing, what is it for and why has it only started appearing now? We are running on Magento 1.9.2.3


texts: Magento 2 : How to create multiple shipping label with single order in UPS

texts:
I am using UPS shipping method. Scenario is :

Suppose order id #123 has 5 items of a product. When clicking on create shipping label button It should create 5 different shipping label within a single package.

What should be my approach? Please suggest


texts: Magento 1.9 pages not found without index.php

texts:
I am working on Magento 1.9.2.1 and setup a copy of website in its root directory in a folder. ex www.website.com/folder

I am not able to access the pages except home page without index.php.
back-end is also not accessible without index.php.

  What i have already tried.

  https://magento.stackexchange.com/a/155399/62788
  CONFIGURATION: System -> Configuration -> (General ->) Web:
  Use Web Server Rewrites: YES

Please Guide me.


texts: Imported products show up in backend but not on front end

texts:
I was able to import products without issue and they would show up fine on the front end. I was in single user mode. I have one store. I have the column product_websites set to base. Nothing has changed in the import sheet I use but now anything I import will not show up on the front end unless I resaved it on the backend.

I ran a reindex manually and the product prices index did return this error (there were more special characters repeated but I left them out):

  Product Price index has been rebuilt successfully in 00:00:01
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '1622-138-1-55' for key 'PRIMARY', query was: INSERT INTO
  catalog_product_index_eav_idx
  (entity_id,attribute_id,store_id,value) VALUES (?, ?, ?, ?),
  (?, ?, ?, ?),

If anyone has any ideas, I'd be very grateful. Thank you!


texts: After resizing original image showing placeholder image in My account page

texts:
we are trying below code to display product thumbinal image in My account section, its working fine.

<?php $_product = $this->getProduct();
$imageUrl=  Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail());
?>
<img src="<?php echo $imageUrl ?>" />

but when we tried to Resize image with help of below code, its displaying Placeholder image

$imageUrl = Mage::helper('catalog/image')->init($product, 'image')->resize(150 ,150)->setQuality(100);

i followed link1 & link2 , both didt worked for me.

edit

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>

<?php $collections = $this->getCollection(); ?>

<?php $_product = $this->getProduct(); ?>

<?php $buttonTitle = Mage::helper('core')->quoteEscape($this->__('Add to Cart')); ?>

<?php foreach ($collections as $key => $product) {

    echo $product->getName().'
';
     echo $product->getId().'
';

    $imageUrl = Mage::helper('catalog/image')->init($_product, 'image')->resize(150 ,150)->setQuality(100);

    ?>

<img src="<?php echo $imageUrl ?>" />

<form action="<?php echo  Mage::helper('checkout/cart')->getAddUrl($product);?>" method="post">

<button type="submit" title="<?php echo $buttonTitle ?>" class="button btn-cart" >

    <?php echo $buttonTitle ?>

</button>

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

</form>

<?php

}
?>


texts: Validate Custom Extension Magento 2.x using validate_m2_package.php

texts:
I created a custom module but trying to convert it to extension.
I am trying to validate my extension with this tool https://github.com/magento/marketplace-tools .
What i tried::
File structure of Market place folder as below :
maddy@maddy:/var/www/html/marketplace-tools$ ls -l
total 2192
-rwxrwxrwx 1 maddy maddy     930 Dec 31 17:58 README.md
-rw-rw-r-- 1 maddy maddy 2211434 Dec 31 19:23 validationcheck.zip
-rwxrwxrwx 1 maddy maddy   27430 Dec 31 17:58 validate_m2_package.php
maddy@maddy:/var/www/html/marketplace-tools$

I created the zip from /var/www/html/marketplace-tools/app/code/Namespace/ReviewRating as validationcheck.zip and place as above.
Root file structure of Extension as below.
total 32
drwxrwxrwx 4 maddy maddy 4096 Dec 21 18:46 Block
-rwxrwxrwx 1 maddy maddy  917 Dec 31 19:08 composer.json
drwxrwxrwx 4 maddy maddy 4096 Nov 12 20:00 Controller
drwxrwxrwx 4 maddy maddy 4096 Nov 15 11:26 etc
drwxrwxrwx 2 maddy maddy 4096 Dec 22 11:03 Helper
drwxrwxrwx 2 maddy maddy 4096 Dec 22 10:58 images
-rwxrwxrwx 1 maddy maddy  176 Nov 12 20:00 registration.php
drwxrwxrwx 4 maddy maddy 4096 Nov 12 20:00 view

Executed under command

maddy@maddy:/var/www/html/marketplace-tools$ php validate_m2_package.php -d validationcheck.zip
I got below error

maddy@maddy:/var/www/html/marketplace-tools$ php validate_m2_package.php validationcheck.zip

`ERROR` - "validationcheck.zip": The 'magento/magento-composer-installer' must have specific version(s) as a dependency.

My cosposer.json
{
    "name": "namespace/reviewrating",
    "description": "Namespace ReviewRating description goes here",
    "require": {
      "magento/module-store": "0.74.0-beta4",
      "magento/module-theme": "0.74.0-beta4",
      "magento/module-widget": "0.74.0-beta4",
      "magento/module-backend": "0.74.0-beta4",
      "magento/module-catalog": "0.74.0-beta4",
      "magento/module-email": "0.74.0-beta4",
      "magento/module-ui": "0.74.0-beta4",
      "magento/module-variable": "0.74.0-beta4",
      "magento/module-media-storage": "0.74.0-beta4",
      "magento/framework": "0.74.0-beta4",
      "magento/magento-composer-installer": "*"
    },
    "type": "magento2-module",
    "version": "0.74.0-beta4",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
    "files": [
    "registration.php"
    ],
    "psr-4": {
      "Namespace\\Reviewrating\\": ""
    }
   }

}

To this
{
    "name": "namespace/reviewrating",
    "description": "Namespace ReviewRating description goes here",
    "require": {
        "magento/module-store": ">100.0",
        "magento/module-backend": ">100.0",
        "magento/framework": ">100.0"
    },
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "proprietary"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Namespace\\Reviewrating\\": ""
        }
    }

}

I used the composer file of another extension and i am confused about version numbers and the lines under require tag ?


texts: Need different price formatting on list view and product view

texts: I need different price formatting on list view and product view but both views use the same template template\catalog\product\price.phtml to display the price. Is there a way to distinguish if list view or product view is calling the template?


texts: How to add note have link to component in form ui

texts:
Is there a way to add note with link to form ui component. I have try ui way below but it doesn't work
Ui way

<field name="fieldname">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Field Label</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="notice" xsi:type="string"><![CDATA[here]]></item>
            </item>
        </argument>
    </field>

Old way to add note

$this->addField("fieldname", [
    'label'  => __('Field Label'),
    'type'   => 'select',
    'note'   => __('here')
    ]);

Is possible to do old way in ui way


texts: Only one coupon per customer in magento shoppin cart price rule

texts:
I am using Magento ver. 1.9.2.0 and I have the following issue with coupon codes. I have set up a shopping cart rule which uses a coupon code. I want customers to be able to use this coupon only once, so I set up Uses per Customer to 1. but this rule not work customer use many time same coupon code
and i have set the discount amount 0.

find the screenshot below


texts:
I want to Show up Add gift messages option in the product page.

Currently, this option is showing in checkout out, but I need this option in the product page itself.

If I use custom option, for many products this may be difficult, so I need the way to do this in programmatically.

Any Ideas?


texts:
Please forgive my ignorance. I've been successfully building & managing Magento 1 stores for a few years and I usually manage to muddle my way through server configurations & installs with little errors.

I decided to try my hand at Magento 2 and have found it to be all new levels of complicated. I've installed, designed and launched a new Magento store, all payment methods are working except for Braintree. I have signed up for an account, had it approved, followed guides to enter API keys etc but I'm getting Payment errors. I used developer tools to track it down to an error 400 Bad Request.

I spoke to Braintree who have passed me back to the Magento community. They can see that my site is communicating with Braintree but when passing the client token back to Magento, the software is not handling it. His exact words were "Magento is not handling the client SDK token or there is no valid SDK link"

Client tokens etc are double dutch to me and I never had any issues like this with Magento 1.9! Are there any guides etc I can follow that may point me in the right direction?

Thanks in advance.


texts: Putting external website with products inside my website

texts:
I'm running Magento 1.9.

One of my suppliers has set up a system where you can have their products in a non branded website and use it yourself.  This would save hours putting products on and also when they update, we'd be automatically updated.    Is it possible to put the weblink they gave me somewhere so when I click a category on my homepage, it would open their site in where the sub categories and products would show whilst staying on my page?  You'd ideally have no idea that you were browsing another site as it would be within my site.  I imagine this would be bad for SEO though.

I know I've not explained that very well but hopefully you'll understand what I mean :)


texts: Which version of Supee-8788 required for C.E 1.9.0.1

texts:
My magento instance is C.E  - 1.9.0.1

And at my instance Supee-8788 not installed Yet.

So, i want to know which Supee-8788 version need to  be install  for my instance ? V1 or V2!!

Magento download only give us to  download supee-8788-V2.

Currently my system have below patches:

SUPEE-5344
SUPEE-1533
SUPEE-5998
SUPEE-6285
SUPEE-6482

My question is which patch are required to install at C.E. -1.9.0.1

SUPEE-3941 is required to installed ?
SUPEE-8788 v1 is required to installed ?
SUPEE-8788 v2 is required to installed ?


texts: How to fix 503 Service Unavailable in Magento 1.x

texts: I didn't install any new extension, checked and deleted file maintenance, but it still didn't work, please help me.


texts: The configuration parameter "formElement" is a required for custom attribute product field

texts:
I just add custom attribute to my product like this:

<?php

namespace  Namespace\Module\Setup;

use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetup;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
/* irrelevant */
#use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
/* irrelevant */
#use Magento\Framework\Setup\SchemaSetupInterface;
/* add this */
use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class UpgradeData implements  UpgradeDataInterface
{
    private $customerSetupFactory;

    private $eavSetupFactory;

    public function __construct(
      EavSetupFactory $eavSetupFactory,
      \Magento\Customer\Setup\CustomerSetupFactory $customerSetupFactory)
    {
        $this->customerSetupFactory = $customerSetupFactory;
            $this->eavSetupFactory = $eavSetupFactory;
    }

    public function upgrade(ModuleDataSetupInterface $setup,
                            ModuleContextInterface $context){
        $setup->startSetup();

        if (version_compare($context->getVersion(), '1.0.3', '<')) {
          $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

            $eavSetup->addAttribute(
                \Magento\Catalog\Model\Product::ENTITY,
                'dimension',
                [
                    'type' => 'decimal',
                    'backend' => '',
                    'frontend' => '',
                    'label' => 'Dimension',
                    'input' => '',
                    'class' => '',
                    'source' => '',
                    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                    'visible' => true,
                    'required' => false,
                    'user_defined' => false,
                    'default' => '1',
                    'searchable' => false,
                    'filterable' => false,
                    'comparable' => false,
                    'visible_on_front' => true,
                    'used_in_product_listing' => true,
                    'unique' => false,
                    'apply_to' => ''
                ]
            );
        }

        $setup->endSetup();
    }
}

but i got an error when i tried to open the form to add product in Admin Page Catalog > Products > Add Product :

  Exception #0 (Magento\Framework\Exception\LocalizedException): The
  configuration parameter "formElement" is a required for "dimension"
  field.


texts:
i am getting order from magento using this query which is fine

$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate));

currently i am getting order for all status but i want skip those ordres which oreder status is
Exclusions :

Order with any of the following status :

Cancelled
On Hold
Complete
Closed
Payment  Review
PayPal Cancelled Reversal
PayPal Reversed
Pending
Pending Payment
Pending  PayPal

how i acheive by query


texts:
There is only one store and one store view. Here is my path;

I disabled cache,

I enabled Inline Translation Feature from Conf>Developer>Inline Translation for Front End>Yes.

After that i opened Mozilla Firefox and typed the url of store and its just seem a normal store. So the problem is Magento is not enabling Inline Translation feature.


texts:
I am currently following a tutorial series which teaches you how to add pages and features within the admin section of your site. The current part I am on shows how to add a grid onto the page.

My problem is that when I get to the page it shows the magento header and footer found in the admin section but the content area is blank. In that blank area I expected to see a grid. I am not getting any error messages (they are on). I have my cache disabled. I am struggling through this tutorial as there are not many descriptions as to what the code is doing and when I should be testing code so I am trying to review code which is being extended and often getting confused.

From what I understand the code that should display the grid is the following

class Excellence_Employee_Adminhtml_EmployeeController
extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

Excellence/Employee/etc/adminhtml.xml

....
  <menu>
    <employee module="employee">
        <title>Employee</title>
        <sort_order>90</sort_order>
        <children>
            <items module="employee"><!--adds menu item-->
                <title>Manage Employees</title>
                <sort_order>0</sort_order>
                <action>adminhtml/employee</action><!--Link-->
            </items>

design/adminhtml/default/default/layout/employee.xml

<layout version="0.1.0">
  <employee_adminhtml_employee_index>
    <reference name="content">
        <block type="employee/adminhtml_employee" name="employee" />
    </reference>
  </employee_adminhtml_employee_index>
</layout>

.

class Excellence_Employee_Block_Adminhtml_Employee
extends Mage_Adminhtml_Block_Widget_Grid_Container
{
public function _construct()
{
    $this->_controller = 'adminhtml_employee';
    $this->_blockGroup = 'employee';
    $this->_headerText = Mage::helper('employee')->__('Employee Manager');
    $this->_addButtonLabel = Mage::helper('employee')->__('Add Employee');

    $this->_addButton('button1', array(
       'label'      => Mage::helper('employee')->__('Button Label1'),
       'onclick'    => 'setLocation(\'' . $this->getUrl('*/*/button1') . '\')',
       'class'      => 'add'
    ));

    $this->_addButton('button2', array(
        'label'     => Mage::helper('employee')->__('Button Label2'),
        'onclick'   => 'setLocation(\'' . $this->getUrl('*/*/button2') . '\')',
        'class'     => 'remove'
    ));

    parent::_construct();
}
}

1 - am I looking at the correct blocks of code?

2a - if not where should I look?

2b - if so, why isn't the grid showing up?

If it helps the two tutorials that I have been following are Tut1 and Tut2. At the end of Tut1 is the time the author says the grid should be displayed and tut2 adds to that grid, I have added tut2 just incase there is some relevant information in there


texts: Magento 2 Contact Form does not send email, but all transactional emails work

texts:
In Magento 2.3.5-p1 build we're having issues with the contact form sending emails.
On the client/user side, everything appears to work fine. The form submits without issue and then displays the success message.
However, we never actually receive the email in our inbox. All other emails seem to work, account, orders/transactions, etc.
Anybody have any ideas as to what would cause just the contact form to not send emails?
I'm assuming Magento uses the same method to send the contact form email as the other transactional emails?
I see nothing in the logs and as far as I can tell, the email appears to send, it just never ends up in our inbox (yes, we've checked the Spam folder as well).


texts: Change the Color Attribute Links to image/icon in Layered Navigation

texts:
I am new to Magento I would like to change the color attribute links to an image or icon in the layered navigation as per the pic give below

I need to make it possible through programmatically. Please help in this regard.


texts:
I remember there was a bug in Magento 1.7 and EE 1.12 which generated URL writes each time a category was saved. We noticed this when clients started seeing millions of URL rewrites. There was a patch for EE1.12 which also worked for 1.7. Do you know if this bug was fixed in 1.8? The reason I ask is I have a client who started at 1.3 and is now on 1.8 and their urls are at 200,000 (6700 SKU's 300 categories)

The URLS have grown by 20,000 in the past week along.


texts: Fresh Magento2.4.1 install does not show categories

texts:
I have a fresh Magento2 install. However no categories are shown on the from side of the website. I ensured there are categories made and all are set to enabled and to include in menu. I also confirmed the store view is assigned to the one and only root category I have setup.
when I view the exceptions log I see
Main.CRITICAL: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [price_view_value]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_1_v1","node":"60InrkNyTY-9Baa0sh763w","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [price_view_value]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [price_view_value]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [price_view_value]"}}},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [price_view_value]\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magento2_product_1_v1\",\"node\":\"60InrkNyTY-9Baa0sh763w\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [price_view_value]\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [price_view_value]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [price_view_value]\"}}},\"status\":400} at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []


texts:
I have successfully added an admin controller which extends Mage_Adminhtml_Controller_Action and works, now I am trying to use a block and template.

I expect to see the text "text here", but I don't see any text, I see the Magento admin header/footer with a blank area, at this URL:
http://127.0.0.1/magento2/index.php/admin/c2/index/key/f5b1fd39ee6e77040cb4c6fbe7340ffd/
(Obviously, the link is a localhost link, but I've shown it for verification!)

My namespace is NS1

My module is Component Management

Here's my files.

app/code/local/NS1/ComponentManagement/controllers/c2Controller.php

<?php
class NS1_ComponentManagement_c2Controller extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

--

app/code/local/NS1/ComponentManagement/Block/Adminhtml/MyBlock.php

<?php
class NS1_ComponentManagement_Block_Adminhtml_ComponentManagement extends Mage_Adminhtml_Block_Template
{
    public function methodblock()
    {
        return 'text here';
    }
}

--

app/design/adminhtml/NS1/ComponentManagement/template/company.php

<?php
echo $this->methodblock();

--

app/design/adminhtml/NS1/ComponentManagement/layout/adminhtml.xml
<?xml version="1.0"?>
<layout version="0.1.0">
    <mymodulename_adminhtml_mymodulename_index>
        <reference name="content">
            <block type="NS1_ComponentManagement/adminhtml_componentmanagement" name="NS1.ComponentManagement" template="company.phtml" />
        </reference>
    </mymodulename_adminhtml_mymodulename_index>
</layout>

--

app/code/local/NS1/ComponentManagement/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <NS1_ComponentManagement>
            <version>0.0.1</version>
        </NS1_ComponentManagement>
    </modules>
    <frontend>
       <routers>
          <routeurfrontend>
              <use>standard</use>
              <args>
                 <module>NS1_ComponentManagement</module>
                 <frontName>test</frontName>
              </args>
           </routeurfrontend>
       </routers>
       <layout>
            <updates>
                <ComponentManagement>
                    <file>test.xml</file>
                </ComponentManagement>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <ComponentManagement>
                <class>NS1_ComponentManagement_Block</class>
            </ComponentManagement>
        </blocks>
        <helpers>
            <ComponentManagement>
                <class>NS1_ComponentManagement_Helper</class>
            </ComponentManagement>
        </helpers>
    </global>
     <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <NS1_ComponentManagement after="Mage_Adminhtml">NS1_ComponentManagement</NS1_ComponentManagement>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

--


texts: Translating the custom text in form.phtml file

texts: I have added some paragraph to form.phtml file and added the translation in the .../locale/nl_NL/Mage_Contacts.csv. But the custom text does not get translated in contact us page when I switch the languages. I have refresh the cache of magento and browser. What step is missing?


texts: Unable to install Modules Magento 2.2 ( Readiness Check Error)

texts:
Im trying to install a few modules for the better functionality of my store.

I've previously installed modules and themes and have basic knowledge about using SSh, etc.

However I'm facing a few problems while installing different Modules(Extensions from Magento Marketplace and also Github).

When i install this module from SSH Host using module:enable command.

Update:

Thats how my admin panel looks

That is how my site looks


texts: Magento new orders are placed as guest in the general group

texts:
Suddenly a month ago our shop started getting some new orders with customers defined as guest while being in the general group.

These customers do not fall into the NOT LOGGED IN group, in the database the field customer is guest is set to 0 and orders say that they belong in the general group.

The problem is that because of that, their first and last name are missing from the db, as well as their email and of course they don't have a customer ID.

We haven't done any change and these behaviour seems to be completely random. Most of our orders are fine and behave normally...


texts: Get Config Path value based on website scope

texts:
From a CMS Page, block or transactional email it's possible to get a config path value for the website url with:

{{config path="general/store_information/country_id"}}

Is it possible to get this value for a specific website scope, say I have to websites in our magento installation, one for the Netherlands and the other for the UK.  Is it possible to get the UK value here from the Netherlands website with something like...

{{config path="web/unsecure/base_url" website="2"}}


texts: How do I get a response from REST API in JSON format in Magento 2?

texts: I used the resources in “Creating a New REST Web Service in Magento 2” and “Creating a New REST Web Service in Magento 2” to create a custom API module, but the response is in XML format. I need a response in JSON format with key value pairs. How can I do this?


texts: Show brand name of products in wishlist page

texts:
I want to show the brand names of products in my wishlist page, but it only shows the name of the products.
This is the .phtml file where the wishlist items are loaded.
How can I also load in the brand name of the product?
<?php
/** @var \Magento\Wishlist\Block\Customer\Wishlist\Items $block */
$columns = $block->getColumns();
$mbHelper = $this->helper('MageBig\MbFrame\Helper\Data');
$class = $mbHelper->getPageColumn();
?>

    <?php if (count($block->getItems())): ?>

        <?php foreach ($block->getItems() as $item): ?>
        <li class="product-item <?= $class ?>" id="item_<?= $block->escapeHtmlAttr($item->getId()) ?>">

                <?php foreach ($columns as $column): ?>
                    <?php $column->setItem($item); echo $column->toHtml($item);?>
                <?php endforeach; ?>

        <?php endforeach; ?>

    <?php else: ?>

            <?= $block->escapeHtml(__('This Wish List has no Items')) ?>

    <?php endif; ?>

<?php foreach ($columns as $column): ?>
    <?= $column->getAdditionalHtml() ?>
<?php endforeach; ?>


texts:
I'm trying to update the order status and add an order comment. I've found by looking at the Swagger reference that the best endpoint for this is likely:

/rest/V1/orders/9/comments

To which I'm posting the following array to:

    {
    "statusHistory": {
        "comment": "Transferred",
        "created_at": "2018-06-01  15:22:04",
        "entity_id": 9,
        "is_customer_notified": 0,
        "is_visible_on_front": 1,
        "status": "transferred"
    }
}

However, when I check the order in Magento Admin it's updating the order status to "transferred" correctly but isn't actually adding a comment to the order at all.

Magento Version: 2.2.3


texts: How to add custom css and js file in Magento 2?

texts:
I want to add my custom css and js files in my catalog page. Please let me know how to add in header.

I added catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <head>
        <css src="Sub_Categorylist::css/category_css_slider.css"/>
        <css src="Sub_Categorylist::css/category_css_theme_slider.css"/>

        <script src="Sub_Categorylist::js/category_slider.js"/>
        <script src="Sub_Categorylist::js/category_slider.min.js"/>
    </head>

</page>

Please let me know is there any corrections.

Thanks In Advance..!


texts: How to keep Guest customer billing info saved on checkout step if page refreshed or when hit the back

texts:
We have the following situation in Magento:

Guest customer is about place order.
The customer filled his billing and shipping addresses on checkout page.
The customer reached one of the following checkout steps (shipping methods, payment methods, order review).
The customer decides to edit his cart and goes back to cart page
The customer reaches the checkout page again then billing information should display

How can store and retrieve the customer information


texts:
I've added a module to my website and ran those commands

php bin\magento setup:upgrade
php bin\magento setup:di:compile
php bin\magento setup:static-cotent:deploy
php bin\magento cache:flush

since then admin panel sidebar doesn't respond and when I've tried to log in to admin panel from another browser it has no style

how to solve this problem


texts: Add full version of jquery mobile to magento2

texts:
Magento2 loads by default a custom build of jquery mobile library:

deps: [
    "jquery/jquery.mobile.custom",

If I try to add the full version of the mobile library (require it in my theme):

var config = {
    map: {
        '*': {
            fullJqueryMobile : 'Module/js/full_jquery_mobile'
        }
    }
}

then magento2 js functionality doesn't work (add to cart for example, but without errors in the console, just the page doesn't do anything), but the full library gets loaded and I am able to use the functionality. So there is a conflict somewhere.

How do I add it without breaking up magento functionality?


texts: Magento2 remove some addresses on checkout page when selecting shipping address

texts: When i create account in magento2 when i add billing and shipping address in the address book that are different, i want on checkout page on shipping step in the shipping address i want to hide the billing address, or hide the ship hire button.


texts: How to filter related product collection by is_salable magento 2?

texts:
Related products are showing with out of stock products, I want to hide out of stock products from related products only.

$this->_itemCollection = $product->getRelatedProductCollection()
    ->addAttributeToSelect('required_options')
    ->setPositionOrder()
    ->addStoreFilter();

I have found above code to get related product collection. How can I filter this collection by is_salable?


texts: Magento 2 - checkout page - make default country selected

texts:
I am working on a site made with magento 2.
My client asks me to make our default country (italy) selected in the checkout page.
How can i make it selected by default?
Thank you


texts: How to Override Product Shipping Price in Magento 2?

texts:
I found this solution, but error is coming which is undefined $method.

The code which I found was this:

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
      <preference for="Magento\OfflineShipping\Model\Carrier\Tablerate" type="Vendor\Extension\Model\Carrier\Tablerate" />
</config>

  app\code\Vendor\Extension\Model\Carrier\Tablerate.php

 <?php
namespace Vendor\Extension\Model\Carrier;

use Magento\Quote\Model\Quote\Address\RateRequest;

class Tablerate extends \Magento\OfflineShipping\Model\Carrier\Tablerate
{
    public function collectRates(RateRequest $request)
    {
        //Do your logic before this line and return your custom price.
        $shippingPrice = 50;
        $method->setPrice($shippingPrice);
    }
}


texts: How to re save all products in Magneto 2

texts:
I'm Using this below Script, but on executing my page lands to Error 503.

Can anyone, please help me in re-saving all the product programmatically

<?php
use Magento\Framework\App\Bootstrap;

include 'app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');

$productCollectionFactory = $objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
$productcollection = $productCollectionFactory->create()
                        ->addAttributeToSelect('*')
                        ->load();

foreach ($productcollection as $product) {
    $productId = $product->getId();
    $product = $objectManager->create('Magento\Catalog\Model\Product');
    $product->load($productId);
    $product->save();
}
?>

Thank you.


texts: Split Orders by available products and out of stock products

texts: I want to create the module which split orders by available products and out of stock products.  Let's say they order 10 items and 8 are in stock and 2 are out-of-stock. When they place their order.


texts:
Is it possible to have a random sort when searching with repositories? Checked dev docs and unsure. Not found much elsewhere.

https://devdocs.magento.com/guides/v2.3/extension-dev-guide/searching-with-repositories.html#sorting

use Magento\Framework\Api\FilterBuilder;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\Api\SortOrder;
use Magento\Framework\Api\SortOrderFactory;

$this->searchCriteriaBuilder->addFilter(MessageInterface::STATUS, [Data::ENABLED], 'eq');
$randomSort = $this->sortOrderFactory
    ->create()
    ->setField(MessageInterface::SORT)
    ->setDirection(SortOrder::SORT_ASC); // random sort here
$this->searchCriteriaBuilder->setSortOrders([$randomSort]);
$searchCriteria = $this->searchCriteriaBuilder->create();
return $this->messageRepositoryInterface->getList($searchCriteria)->getItems();


texts: Seting specifc ID/entity ID to categories

texts:
I have a script that gets all categories on a csv file and starts creating them in DB (categoreis and subcategories...). I need to set specific IDs to the categories and subcategories, but currently I am having trouble to set the IDs.  When I try to set it, the categories and subcategories break.

Here is an example of my csv file structure:

  ID,ParentID,Name,top,columns,sort_order,Image,date_added,date_modified,language_id,seo_keyword,description,meta_description,meta_keywords,store_ids,layout,Status

355,2,Jewellery Boxes,,,,data/100-0-jewelleryboxes.jpg,,,,Jewellery Boxes,,,,,,TRUE
356,355,Leatherette Boxes,,,,data/106-100-leatheretteboxes.jpg,,,,Leatherette Boxes,,,,,,TRUE

My code:

require '../app/Mage.php';
umask(0);
Mage::app();
Mage::register('isSecureArea', 1);

function getCategories()
{
    $file = 'categorias-novo.csv';
    $arrResult = array();
    $headers = false;
    $handle = fopen($file, "r");
    if (empty($handle) === false) {
        while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
            if (!$headers) {
                $headers[] = $data;
            } else {
                $arrResult[] = $data;
            }
        }
        fclose($handle);
    }
    return $arrResult;
}

$ar = getCategories();

function importCategories($arrResult)
{

    //Mage::register('isSecureArea', 1);
    $parentId = '2';
    $list = array();
 $counter = 0;
    foreach ($arrResult as $import_category) {
        try {

            $enabled = 1;
           /* return var_dump($import_category[16]);
            if (strtolower($import_category[16]) == 'true') {
                $enabled = 1;
            } else {
                $enabled = 0;
            }*/
   $parentId = $import_category[1];
            if ($import_category[1] == 2) {
                $parentId = '2';
            }
            else {

                $parentId = $list[$import_category[1]];
            }

            $category = Mage::getModel('catalog/category');

            //return var_dump($import_category);

            $category->setId($categoryID);
           //$category->setId($import_category[0]);
           //  $category->setEntityId($desiredId);
            $category->setName($import_category[2]);
            $category->setMetaTitle($import_category[2]);
            $category->setIncludeInMenu(1);
            $category->setUrlKey($import_category[10]);
            $category->setDescription(strip_tags($import_category[11]));
            $category->setMetaDescription($import_category[12]);
            $category->setMetaKeywords($import_category[13]);
            $category->setIsActive($enabled);
            $category->setDisplayMode('PRODUCTS');
            $category->setIsAnchor(1); //for active anchor
            $category->setStoreId(0);

            $parentCategory = Mage::getModel('catalog/category')->load($parentId);

            $category->setPath($parentCategory->getPath());
            $category->setCustomUseParentSettings(true);
            $category->setImage($import_category[6]);

          $category->save();
            $list[$import_category[0]] = $category->getId();
            echo 'Category ' . $category->getName() . ' ' . $category->getId() . ' imported successfully' . PHP_EOL;
        } catch (Exception $e) {
            echo 'Something failed for category ' . $import_category[2] . PHP_EOL;
            print_r($e);
        }
    }

    return $list;

}

importCategories($ar);

Can anyone tell me, what's wrong with my code ?


texts: Plugin for ShippingMethodManagement no longer called when upgrading from Magento 2 beta4 to 2.0.0 release

texts:
I upgraded from the beta4 to the Magento 2.0.0 release.
Now, I plugin I defined is no longer executed.

My app/code/Example/Product/etc/frontend/di.xml looks like this:

<?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\Checkout\Controller\Cart\Add">
          <plugin name="forceJson" type="Example\Product\Controller\Checkout\Plugin" sortOrder="1"/>
      </type>
      <type name="Magento\Checkout\Controller\Cart">
          <plugin name="forceJson" type="Example\Product\Controller\Checkout\Plugin" sortOrder="1"/>
      </type>
      <type name="Magento\Quote\Model\ShippingMethodManagementInterface">
          <plugin name="allowEmptyQuotes" type="Example\Product\Model\Quote\ShippingMethodManagement\Plugin" sortOrder="1"/>
      </type>
</config>

My app/code/Example/Product/Model/Quote/ShippingMethodManagement/Plugin.php

namespace Example\Product\Model\Quote\ShippingMethodManagement;

use Magento\Quote\Model\Cart\ShippingMethodConverter;
use Magento\Quote\Model\QuoteRepository;

class Plugin
{
      /**
       * Quote repository.
       *
       * @var QuoteRepository
       */
      protected $quoteRepository;

      /**
       * Shipping method converter
       *
       * @var \Magento\Quote\Model\Cart\ShippingMethodConverter
       */
      protected $converter;

      /**
       * @param QuoteRepository $quoteRepository Quote repository.
       */
      public function __construct(
          QuoteRepository $quoteRepository,
          ShippingMethodConverter $converter
      ) {
          $this->quoteRepository = $quoteRepository;
          $this->converter = $converter;
      }

      /**
       * Allow empty quote for calculating the shipping methods / costs
       *
       * Plugin for: @see \Magento\Quote\Model\ShippingMethodManagement::estimateByAddress
       *
       * @param $subject
       * @param $result
       */
      public function aroundEstimateByAddress(
          \Magento\Quote\Model\ShippingMethodManagement $subject,
          \Closure $proceed,
          $cartId,
          \Magento\Quote\Api\Data\EstimateAddressInterface $address
      ) {
            // [...]
            xdebug_break(); // never called

      }
}

When I debug into
\Magento\Quote\Model\ShippingMethodManagement\Interceptor::estimateByAddress, this function is called, but there $pluginInfo is null, so my plugin is not executed.

What change did I miss between beta4 and 2.0.0 ? My module does have a registration.php, and other parts of the module are loaded. If I put a syntax error in my di.xml, the Magento instance crashes as expected.


texts: TypeError: registry is undefined JS Error

texts:
I recenly have had the following JS error start to appear on every page on my Magento website:

TypeError: registry is undefined - Line 5557:9

Has anyone else experienced this issue before and know how to resolve it?


texts: Magento 2 - How to rearrange Customer "My Account" links

texts:
Now it looks like this:

Account Dashboard
Account Information
Address Book
My Downloadable Products
My Orders
Newsletter Subscription
Billing Agreements
My Product Reviews
My Wish List

I want to change the order to something like this:

Account Dashboard
My Orders
My Downloadable Products
My Wish List
My Product Reviews
Newsletter Subscription
Account Information
Address Book
Billing Agreements

I would prefer to edit the existing module and not to make new one

There is a similar question on stackexchange but it is for Magento 1
How to change magento My Account links order

Thanks!


texts:
I'm trying to track member applications referred by my CPC Ads.
I've set everything up on the Adwords end to track this and they have produced a snippet to place in the header of the "thank you" page.

However I can't seem to find a way using magento 1.9 to edit the header code of a specific page, only the header code of every page such as for the overriding adwords/analytics code which I've already set up.

Any help would be appreciated.


texts: How to Show Cart Discount in magento 2, without using any extension


texts: what version of php is recommended magento 1.9.1.1

texts:
What version of php is recommended with magento 1.9.1.1?

I was running PHP 5.3.29, and ran into problem of Sales>Orders>Order View Information were not getting displayed in admin after the latest SUPEE-7405!  So I upgraded the PHP version to 5.4.45, and it started to display Sales>Orders>Order View Information again.

My cPanel has 5.5.32 and 5.6.18 also available. Is it recommended to upgrade to any of them or not?


texts: is it possible to create mobile app using the rest api / or soap?

texts:
I'm evaluating is it possible to create a mobile app by using the rest api / soap. i've checked the rest api, seems there are some feature are missing in rest api, for example: adding the product into shopping cart, checkout

http://www.magentocommerce.com/api/rest/introduction.html

on the other hand, seems the soap is more complete
http://www.magentocommerce.com/api/soap/checkout/cartProduct/cartProduct.html

anyone has experience in magento api? is it possible to create mobile app (add product to cart then checkout) using the rest api / or soap and also using phonegap on mobile side?


texts: Moving code just before end of body tag, but for specific page/template

texts:
I need to put my html/js code just before end of body tag (</body>) on last checkout page (\template\checkout\success.phtml)

But after success.phtml I still have footer and wraper code. How to move my code from end of template success.phtml to end of whole page.

This needs to be only for that page, not for whole website.


texts: Magento 2.2.5: Error on running setup: upgrade after upgrading Magento from 2.2.2 to 2.2.5

texts:
I am facing issues with Magento Upgrade from 2.2.2 to 2.2.5. After upgraded, I ran setup:upgrade command several times, but each time It takes too much time in Module_Sales upgrading data.
After taking so long, It returns error We can't save the address, Email has a wrong format.

Can anyone help me? Thank You


texts: Magento 1.9 - How to get JSON config by a bundle item id in cart?

texts: When I have a bundle product in the cart, I can edit it by clicking the edit button . At this point, a page with the product to edit will be loaded. Also, a function named "getJSONConfig()" will be called in order to load the product data. I only need this function, how can I call it having the item_id only?


texts: Rewrite for third party module's model not working

texts:
By using the third party module, There is a option in admin configuration side to select the number of columns for the catalog page. I want to add an additional column option in the admin configuration side.

In third party module Model/Columncount.php

    <?php class Third_Party_Model_Columncount
    {
        public function toOptionArray()
        {
            return array(
  array('value'=>'3', 'label'=>Mage::helper('ThemeConfig')->__('3 Column Grid')),
  array('value'=>'4', 'label'=>Mage::helper('ThemeConfig')->__('4 Column Grid')),
  array('value'=>'5', 'label'=>Mage::helper('ThemeConfig')->__('5 Column Grid'))
                );
    }
    ?>

I need to add one more option with it,

For that I made an module to rewrite model as below

My_Module.xml

<config>
  <modules>
    <My_Module>
        <active>true</active>
        <codePool>local</codePool>
        <depends><Third_Party/></depends>
    </My_Module>
  </modules>
</config>

in the My/Module/etc/config.xml

<config>
    <modules>
      <My_Module>
       <version>0.1.0</version>
      </My_Module>
    </modules>
    <global>
        <models>
        <module>
        <class>My_Module_Model</class>
        </module>
            <party>
                <rewrite>
                    <columncount>My_Module_Model_Columncount</columncount>
                </rewrite>
            </party>
        </models>
    </global>
</config>

and in My/Module/Model/Columncount.php

<?php class My_Module_Model_Columncount extends Third_Party_Model_Columncount
{
    public function toOptionArray()
    {
        return array(
        array('value'=>'3', 'label'=>Mage::helper('ThemeConfig')->__('3 Column Grid')),
        array('value'=>'4', 'label'=>Mage::helper('ThemeConfig')->__('4 Column Grid')),
        array('value'=>'5', 'label'=>Mage::helper('ThemeConfig')->__('5 Column Grid')),
        array('value'=>'6', 'label'=>Mage::helper('ThemeConfig')->__('6 Column Grid'));
    }

}?>

But it is not getting rewritten, why? Can anyone help here.


texts: how to show product SKU below product name only on product page

texts: I am using porto theme in magento 1.9. i want to display product SKU only on product page below product name. how can we add product SKU on product page.


texts:
I custom add to cart module on Magento 2 and keep message like Magento core.

if (!$this->_checkoutSession->getNoCartRedirect(true)) {
    if (!$this->cart->getQuote()->getHasError()) {
        $message = __('You added %1 to your shopping cart.', $product->getName());
        $this->messageManager->addSuccessMessage($message);
    }
    return $this->goBack(null, $product);
}

After add to cart success, it return message "Product name add to cart success".
But when I access to another page, that message still display.

Ex: I clicked add to cart, when it was loading, I quickly clicked to cart(checkout/cart). Success message was display at there. How can I remove that message, I just want it display one time at product(where click add to cart) page. I use Magento 2.0.7


texts: How to proceed checkout method login to billing information?

texts: I have some issues in checkout page on magento. When i add products to cart and proceed to checkout, In checkout method when i login to checkout its not proceeding to billing information or shipping information on same page. Instead of its redirecting to login page from there its redirecting to mydashboard page. If i want to checkout, again i need to click cart page and proceed to checkout. I would like clear this issue any ideas ?


texts: Input value must contain number higher than 5

texts:
In my contactform I want to display a inputfield, that may only contain a number, higher than 5.

How can I achieve that?

My current code is:

            *<?php echo Mage::helper('contacts')->__('Requested qty') ?>

                <input name="gewensteaantal" id="gewensteaantal" title="<?php echo Mage::helper('contacts')->__('Requested qty') ?>" value="" class="input-text required-entry" type="text" />


texts: I want to move magento2 to live server but No app/etc/local.xml in my magento 2?

texts:
I am trying to move my local Magento site to my Live server. (XAMPP to cPanel)

To do this I have exported the database, etc and all those steps are fine.

However i get error on tables in my phpmyadmin on cpanel, also i read that i should edit the local.xml file but i don't have that file in my app/etc folder rather i have config.php, env.php, di(which is xml)file.

Does anybody know if I am doing this step correctly, or is there a different way to get my Magento files from my Local site to my Live site. or how i can manually set local.xml in magento 2.0

My env.php looks like this

<?php
  return array (
  'backend' =>
  array (
  'frontName' => 'admin',
  ),
 'install' =>
  array (

 'date' => 'Mon, 18 Apr 2016 14:27:37 +0000',

  ),
   'crypt' =>
  array (
    'key' => '51b8c74ff74f2b568c1025da3b4be0f4',
  ),
  'session' =>
  array (
    'save' => 'files',
  ),
  'db' =>
  array (
    'table_prefix' => '',
    'connection' =>
    array (
      'default' =>
      array (
        'host' => 'localhost',
        'dbname' => 'fashmart247',
        'username' => 'root',
        'password' => '',
        'active' => '1',
      ),
    ),
  ),
  'resource' =>
  array (
    'default_setup' =>
    array (
      'connection' => 'default',
    ),
  ),
  'x-frame-options' => 'SAMEORIGIN',
  'MAGE_MODE' => 'default',
  'cache_types' =>
  array (
    'config' => 1,
    'layout' => 1,
    'block_html' => 1,
    'collections' => 1,
    'reflection' => 1,
    'db_ddl' => 1,
    'eav' => 1,
    'config_integration' => 1,
    'config_integration_api' => 1,
    'full_page' => 1,
    'translate' => 1,
    'config_webservice' => 1,
  ),
);


texts: Bulk Products import are not showing on front end

texts: I have uploaded bulk products through using a CSV file.  The products get uploaded successfully and can be found on the back end, but they are not showing on front end. When I edit a product and save it without any changes, it can then be found on the front-end. I cannot save each product as it is nearly 1000 products. I also reindex and flush cache without results. I am using Magento 1.9.2 version. What is the issue? Kindly any one help me out. Thanks in advance


texts:
I have added a new Magento 2 email template from Marketing->Communications->Email Templates.

How do I get a list of them in my custom extension code? What class/model do I need to call to be able to get them all into an array, or at least load one template by template ID.

Thanks!


texts: Magento Admin panel will not fully load Edit Categories due to AJAX call to a non secure endpoint

texts:
We have a Magento site that was copied over from an existing Magento site we have, so all products, setting, etc are simply copied to a new domain.

This was done months ago but I am just now trying to use the site.  Frontend of site seems to be working great.

Admin panel, in the edit categories page, it keeps "Loading"

I look at the Browser COnsole on this page instantly see this problem....

Mixed Content: The page at
'https://www.domain.com/index.php/admin/catalog_category/index/key/7ac5ce7838cd82114132424faf2b5656/'
was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint
'http://www.domain.com/index.php/admin/catalog_category/edit/key/40eeadefd754406a47f2993be70c4472/?isAjax=true'.
This request has been blocked; the content must be served over HTTPS.

So it appears this page is making an AJAX call to http://www.domain.com/index.php/admin/catalog_category/edit/key/40eeadefd754406a47f2993be70c4472/?isAjax=true notice the http instead of https

I think fixing this will fix our issues.

In admin config I saw this setting: Use Secure URLs in Admin was set to No so I changed it to yes but no luck on the error going away just yet.

Any ideas how to resolve this please?

UPDATE

It seems my Admin setting for ``Use Secure URLs in Adminis not saving!  So changing it;s value toyesis not saving and end up staying asno` so it seems we have more issues.  The solution to the admin setting saving could fix the other issue.

Any ideas here?


texts: Magento 2 - Create product programmatically with different store view values

texts:
I have created this custom import module that will create products and set different values for each store view. The problem is, when I save a single attribute for the product on a store view, all the other attributes are saved to it as well for that store view. I want the store view version to inherit (use default) all values except the one I'm changing (description).

This is stripped/simplified version of the script:

// Create a product model using \Magento\Catalog\Model\ProductFactory
$productModel = $this->productFactory->create();

// Set the default values
$productModel
  ->setStoreId(0)
  ->setName($name)
  ->setAttributeSetId($productModel->getDefaultAttributeSetId())
  ->setWebsiteIds([1,2])
  ->setVisibility(4)
  ->setUrlKey($urlKey)
  ->setStatus(2)
  ->setTypeId('simple')
  ->setPrice(10)
  ->save();

// Reload product
$productStoreView = $this->productFactory->create()
  ->load($productModel->getId())
  ->setStoreId(1)
  ->setDescription('Desc for store view 1')
  ->save();

$productStoreView = $this->productFactory->create()
  ->load($productModel->getId())
  ->setStoreId(2)
  ->setDescription('Desc for store view 2')
  ->save();

The result now when I, using Magento 2 admin, looking at the product, each store view has it's own values for status, name etc set for each store view when it should only be "description" that isn't using default value.

Any tips on what I'm doing wrong?

Updated 2017-01-30:

I've started up a brand new environment with a fresh Magento 2.1.3 install. Then I created a new website, store and store view with the same root catalog.

After that, I saved this script in pub/test.php and executed it via CLI (I know it's not best practice, it's just to test/prove my case).

I visit admin and click on the newly created product. The default view looks as it's supposed to. I then switch stores and status is not using default value among other attributes.

<?php

use Magento\Framework\App\Bootstrap;

require __DIR__ . '/../app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);

$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$product = $obj->get('Magento\Catalog\Model\Product');

$product
    ->setName('Random name ' . time())
    ->setSku(time())
    ->setPrice(0)
    ->setStatus(2)// Disabled
    ->setWebsiteIds([1, 2])
    ->setVisibility(4)
    ->setAttributeSetId($product->getDefaultAttributeSetId())
    ->setTypeId('simple')
    ->save();

echo "Saved product ID " . $product->getId() . "\n";

$obj->create('Magento\Catalog\Model\Product')
    ->load($product->getId())
    ->setStoreId(1)
    ->setDescription('Description store view 1')
    ->save();

$obj->create('Magento\Catalog\Model\Product')
    ->load($product->getId())
    ->setStoreId(2)
    ->setDescription('Description store view 2')
    ->save();

All store views: https://i.stack.imgur.com/YkGjV.jpg

Store view 1: https://i.stack.imgur.com/C8Tuh.jpg

Store view 2: https://i.stack.imgur.com/uAS2h.jpg


texts: 403 forbidden error while POST content - Nexcess server

texts:
I'm running Magento latest version on Nexcess server.
I  have created custom module to store template design in database. I'm using PHP code within textarea like,
<div> First Name: <?php echo $order->getFirstname?></div>

I'm using form Post method. When trying to save data It's throwing 403 Forbidden error. However when i'm adding same content to the CMS Block, CMS Page and transactional emails, it's working fine.

Note: I have changed all file permission to 644 and folder permission
to 755 except var (777) and media (777).
Apache mod_security extension is enabled on server. But why different
behaviour between CMS page and my custom module.


texts: Magento 2 - Set Cookie Expiry date using "setPublicCookie"

texts:
I am trying to set cookie based on the url params and I need to be able to assign an expiry date and the params value as well

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cookieManager = $objectManager->get('Magento\Framework\Stdlib\CookieManagerInterface');

if(isset($_GET['test']) && $_GET['test'] != ""){
        $eventid = $_GET['test'];
        $expire = 60*60*24*45;
        $cookieManager->setPublicCookie('test',$eventid, $expire,"/");
}

But with this, I am getting Internal Server Error, and when I traced this back, I found this:

[26-Oct-2018 15:05:09 UTC] PHP Fatal error:  Uncaught TypeError: Argument 3 passed to Magento\Framework\Stdlib\Cookie\PhpCookieManager::setPublicCookie() must be an instance of Magento\Framework\Stdlib\Cookie\PublicCookieMetadata or null, integer given, called in /var/www/vhosts/********/app/design/frontend/Pearl/********/Magento_Theme/templates/html/before_body_ends.phtml on line 11 and defined in /var/www/vhosts/********/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php:118
Stack trace:
#0 /var/www/vhosts/********/app/design/frontend/Pearl/********/Magento_Theme/templates/html/before_body_ends.phtml(11): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setPublicCookie('cjevent', 's2df23jok89gd4s...', 3888000)
#1 /var/www/vhosts/********/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/vhosts...')
#2 /var/www/vhosts/********/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Theme\Block\Html\Footer), '/var/www/vhosts...', Array)
#3 /var/www/vhosts/**** in /var/www/vhosts/********/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php on line 118


texts: How to export from DB Sku - Order Number - Quantity Sold?

texts:
Does anybody know how to export from PhpMyAdmin the Quantity sold by products and by Order Number ?

I've already found Sku and Qty Sold in the table Sales_flat_order but I really don't know how to join with order number.

Any idea ?

Thank you very much.


texts: Composer Error While upgrading magento version 2.1.6 to 2.2.2

texts:
I am trying to upgrade the magento version from 2.1.6 to 2.2.2. I am using composer to upgrade the version.

I have used below commands

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

Also I have already removed the "escapesshellarg" from the disable_function string but still I am getting below Error

[ErrorException]
escapeshellarg() has been disabled for security reasons


texts: Magento2 - Add Custom fields block after shipping method

texts:
Want to add custom fields after shipping method at Magento 2 checkout page. I have created custom module with checkout_index_index.xml and able to add custom fields block at after shipping address with <item name="before-form" xsi:type="array"> but i want it after shipping method.

When customer select shipping method this block show and hide to provide more information about selected shipping method

Find Image below for more information.


texts: magento get the phtml file in email template with passing variable from email template to phtml file

texts:
I am trying to get the phtml file data in email template as well as passing variable from email template to phtml file as like below code. but am not getting the data from phtml file

In email template

{{block type='core/template' area='frontend' template='reorder/related_products.phtml' quick=$emailTemplateVariables.customer_name }}

In phtml file:

 print_r($block->getData('quick'));
 print_r($this->getQuick());
 echo get_class($this->getQuick());


texts: Update custom product attribute programatically?

texts:
How can I update custom attribute of a product programatically?

$product->setCustomAttrName('value') does not work


texts: Disallow invoice option when organisation in billing post array is not set to 1

texts:
I have a custom value 'organisation_type' that will be 1,2 or 3. If this is 1 I want to modify the existing code in the PurchaseOrder.php below to set canUseCheckout to true.

so for instance in the billing Post array on the checkout - if billing['organisation_type'] == 1, then canUseCheckout should be set to true otherwise set to false;

Can anyone suggest how this is done looking at my existing code?
Is it possible using getQuote() to get all the values from the billing post array?

DisallowInvoice config.xml

<?xml version="1.0"?>
  <config>
   <modules>
    <AA_DisallowInvoice>
        <version>0.0.1</version>
    </AA_DisallowInvoice>
</modules>
<global>
    <models>
        <disallowinvoice>
            <class>AA_DisallowInvoice_Model</class>
            <resourceModel>disallowinvoice_mysql4</resourceModel>
        </disallowinvoice>
        <payment>
            <rewrite>
                <method_purchaseorder>AA_DisallowInvoice_Model_Payment_Method_Purchaseorder</method_purchaseorder>
            </rewrite>
        </payment>
    </models>
</global>

class AA_DisallowInvoice_Model_Payment_Method_Purchaseorder extends Mage_Payment_Model_Method_Purchaseorder {

public function canUseCheckout()
{
    $this->_shippingAddressCheck();
    return $this->_canUseCheckout;
}

/**
 * If the shipping address is different to the billing address, prevent use within checkout
 */
protected function _shippingAddressCheck()
{
    if (! Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getSameAsBilling()) {
        $this->_canUseCheckout = false;
    }
}

}


texts: Have two different homepages based on customer logged in or not

texts: I have set login page as home page using cms page but I want to display login page as home page before login but after login my category page should display as home page how to do this


texts:
I want get current block in my observer, for example I have observe event

        <catalog_block_product_list_collection>
            <observers>
                <mycompany_category_list_collection>
                    <type>singleton</type>
                    <class>mycompany/category</class>
                    <method>sendProductImpressionAfterLoad</method>
                </mycompany_category_list_collection>
            </observers>
        </catalog_block_product_list_collection>

this is event dispath in block reder category....
I can get this block class, name, file, type or other information for help me indetification this block in my method.


texts:
I'm using Magento 2.3.4 open source and I am looking into how I can achieve zero downtime

The build commands I normally use are:

php bin/magento maintenance:enable
composer install --no-interaction
php bin/magento setup:upgrade
php bin/magento deploy:mode:set production --skip-compilation
php bin/magento config:set dev/css/merge_css_files 1
php bin/magento config:set dev/css/minify_files 1
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_GB en_US
php bin/magento indexer:set-mode schedule
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:enable
php bin/magento maintenance:disable

This works but requires around 2 - 3 minutes of downtime.

Reading answers like https://magento.stackexchange.com/a/75461/6414 I think it's the best method eg have different releases of files and just swap the symlinks over then do the setup:upgrade which would reduce the downtime to like 30 seconds.

But is there anything better? As that answer is 5 years old


texts: Magento2 - Add few custom product attributes to checkout summary

texts:
I followed this instruction for attribute on checkout summary , but I need to add two attributes to the checkout summary.
In file SampWork/ConfigCheckoutDynamicPCB/etc/catalog_attributes.xml I modified it like this:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="quote_item">
        <attribute name="custom_attr1"/>
        <attribute name="custom_attr2"/>
    </group>
</config>

In file SampWork/ConfigCheckoutDynamicPCB/Plugin/Checkout/Model/DefaultConfigProvider.php I modified it like this:
        foreach ($items as $index => $item) {
            $quoteItem = $this->checkoutSession->getQuote()->getItemById($item['item_id']);
            $result['quoteItemData'][$index]['custom_attr1'] = $quoteItem->getProduct()->getAttributeText('custom_attr1');
            $result['quoteItemData'][$index]['custom_attr2'] = $quoteItem->getProduct()->getAttributeText('custom_attr2');
        }

In file SampWork/SampWork/ConfigCheckoutDynamicPCB/view/frontend/web/js/view/summary/item/details.js I modified it like this:
        return Component.extend({
            defaults: {
                template: 'EszCorp_HideShipping/summary/item/details'
            },
            quoteItemData: quoteItemData,
            getValue: function(quoteItem) {
                return quoteItem.name;
            },
            getCHAttr1: function(quoteItem) {
                var item = this.getItem(quoteItem.item_id);
                return item.custom_attr1;
            },
            getCHAttr2: function(quoteItem) {
                var item = this.getItem(quoteItem.item_id);
                return item.custom_attr2;
            },
            getItem: function(item_id) {
                var itemElement = null;
                _.each(this.quoteItemData, function(element, index) {
                    if (element.item_id == item_id) {
                        itemElement = element;
                    }
                });
                return itemElement;
            }
        });

And after this modification extension doesn't work properly.
Hope for your advice.
Thank you


texts: Getting error related to instance of for abstract model class when trying to override function via plugin

texts:
Following is the error I am getting when trying to override validate() via a plugin

Fatal error: Uncaught TypeError: Argument 1 passed to Drummondgolf\Subtotalwithdiscount\Plugin\ProductPlugin::afterValidate() must be an instance of Drummondgolf\Subtotalwithdiscount\Plugin\Magento\Framework\Model\AbstractModel, instance of Magento\AdvancedSalesRule\Model\Rule\Condition\Address\Interceptor given, called in /var/www/html/dg/vendor/magento/framework/Interception/Interceptor.php on line 146 and defined in /var/www/html/dg/app/code/Drummondgolf/Subtotalwithdiscount/Plugin/ProductPlugin.php:16 Stack trace: #0 /var/www/html/dg/vendor/magento/framework/Interception/Interceptor.php(146): Drummondgolf\Subtotalwithdiscount\Plugin\ProductPlugin->afterValidate(Object(Magento\AdvancedSalesRule\Model\Rule\Condition\Address\Interceptor), false, Object(Magento\Quote\Model\Quote\Address\Interceptor)) #1 /var/www/html/dg/vendor/magento/framework/Interception/Interceptor.php(153): Magento\AdvancedSalesRule\Model\Rule\Condition\Address\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Quote\Model\Quote\Add in /var/www/html/dg/app/code/Drummondgolf/Subtotalwithdiscount/Plugin/ProductPlugin.php on line 16

I am trying to override validate() of

/var/www/html/dg/vendor/magento/module-sales-rule/Model/Rule/Condition/Address.php

via plugin but getting above error.

I have already tried with preference but not getting called in frontend

Plugin code

namespace Drummondgolf\Subtotalwithdiscount\Plugin;

use Magento\Framework\Model\AbstractModel;

class ProductPlugin  {
public function afterValidate(Magento\Framework\Model\AbstractModel $model)
    {
        $address = $model;
        if (!$address instanceof \Magento\Quote\Model\Quote\Address) {
            if ($model->getQuote()->isVirtual()) {
                $address = $model->getQuote()->getBillingAddress();
            } else {
                $address = $model->getQuote()->getShippingAddress();
            }
        }

        if ('payment_method' == $this->getAttribute() && !$address->hasPaymentMethod()) {
            $address->setPaymentMethod($model->getQuote()->getPayment()->getMethod());
        }

        // This function is from vendor
        $baseTotalWithDiscount = $address->getBaseSubtotal() + $address->getDiscountAmount();
        $address->setBaseSubtotalWithDiscount($baseTotalWithDiscount);

        return parent::validate($address);
    } }

di.xml code

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
 <type name="Magento\SalesRule\Model\Rule\Condition\Address">
    <plugin name="Mageplaza-yourmodule-product-block" type="Drummondgolf\Subtotalwithdiscount\Plugin\ProductPlugin" sortOrder="5" />
</type>


texts: Magento 2 - "url_key" Product Attribute, force as required and unique

texts:
Is it good practice to force the "url_key" product attribute to be both "required" and "unique" by default?

update eav_attribute set is_required=1,is_unique=1 where attribute_code = "url_key";

As preventative cure for the common issue:

  URL key for specified store already exists


texts: Weird issue with Authorize.net payment module

texts:
In our front end, the customer is able to select their shipping option (matrix rate, all works great) everything goes through and adds up properly. Customer checks out successfully with their credit card via Authorize.net. Smooth as silk.

BUT

On our Authorize.net transaction receipt, the processed amount is the product net value only, EXCLUDING shipping & tax amounts. Huge problem!

Toward the bottom of the tx receipt (under “Additional Information") tax and freight are listed. The values are shown there, but the settlement report only reflects the net cost of the product. We asked the Authorize.net rep about this and she said those fields are only informational, and the shopping cart needs to add the freight to the charge. Otherwise, those values won’t get charged to the customer.

I am desperately looking for a solution here. Has anyone had the same issue and solved it? Does anyone have any tips for us?

Thanks in advance for your help!


texts: what are the minimum steps to run in order to see the updates after edit a php file from the vendor folder

texts:
somehow in my

  /public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php

file there are extra characters accidentally added by one of the team member that creates error when indexing. I removed the extra characters, but i don't see the changes when i try to reindex on the production site.

What are the minimum steps to see the updates i made to that BatchSizeCalculator.php file in the vendor folder?

running php bin/magento c:c and php bin/magento c:f didn't work
I'm trying to stay away from running setup:upgrade setup:di:compile or s:s:d if it is not necessary.

Is there an corresponding file in the generated folder or var folder that i can apply the same update without running the above commands?


texts: magento 2: how to set category as homepage

texts: I have tried displaying particular category products on homepage with widget through back-end. It does work. But i want to have layered navigation on left side as it comes in category product list page. Can i set a category page as homepage with layered navigation?


texts:
I want to override

  "wishlist_index_index.xml"

with some changes.

Default layout output:-

Expected output:-

Here I want to move comment div out side "product-item-info" div.

Please let me know the magento2 best practice to achieve this.


texts: How to rewrite url for custom controller path?

texts:
I have created a controller for my custom module. My controller path is like http://www.example.com/test/index/index which is displaying page correctly. I want to perform URL-rewrite for converting /test/index/index to /test.html

Based on the first answer, I have modified my code as below:

I tried to do something like following, in my config.xml

<frontend>
    <routers>
        <test>
            <use>standard</use>
            <args>
                <modules>
                    <module>Pfay_Test</module>
                    <frontName>test</frontName>
                </modules>
            </args>
        </test>
    </routers>
</frontend>

<global>
    <controller_front_init_routers>
        <observers>
            <test>  <!-- observer identifier -->
                <class>Pfay_Test_Controller_Router</class>
                <method>initControllerRouters</method>
            </test>
        </observers>
    </controller_front_init_routers>

</global>

In /app/code/local/Pfay/Test/Controller/Router.php

<?php
     class Pfay_Test_Controller_Router extends  Mage_Core_Controller_Varien_Router_Abstract{
/**
 * Initialize Controller Router
 *
 * @param Varien_Event_Observer $observer
 */

public function initControllerRouters($observer){
    $front=$observer->getEvent()->getFront();
    $front->addRouter('test',$this);

}

/* validate and modify the  request
 *  Params Zend_Controller_Request_Htt
 */
public function match(Zend_Controller_Request_Http $request){

    /* If Magento Magento is not install then
     * redirect to installer url
     */
    If(!Mage::isInstalled()):
        Mage::app()->getFrontController()->getResponse()
            ->setRedirect(Mage::getUrl('install'))
            ->sendResponse();
        exit;

    endif;
    $requestPathInfo=trim($request->getPathInfo(),'/');
    Mage::log('aaa'.$requestPathInfo.'StoreId'.Mage::app()->getStore()->getId(), null, 'logfile.log');
    /* check -review-form not exit
     * then immediate return false
     */
    if($requestPathInfo!='test.html'):
        return  false;
    endif;

    $request->setModuleName('test')
        ->setControllerName('index')
        ->setActionName('index');
    $request->setAlias(
        Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,
        'test.html'
    );

    return  true;
  }
 }

In /app/code/local/Pfay/Test/Model/Observer.php

<?php
class Pfay_Test_Model_Observer{

public function add($observer){

    $identifier=$observer->getEvent()->getCondition();
    Mage::log('aaa', null, 'logfile.log');

     }

   }

But when I type http://www.example.com/test.html , it is still showing 404 error.Can anybody hint out where it is going wrong?

I am using Magento 1.9, Apache 2.4 and mod_rewrite is enabled.


texts:
On some of my websites I use this code:

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

It works fine on three websites but on one website it doesn't work. I use it in a static block. This static block is displayed on the category pages.

After some testing it seems that almost every line of code with block type is not working. I tried displaying another category and such but with no luck.


texts:
I found this code through Google to add a Button to my shopping cart page under where I have some products begin displayed. However when I click on the button, it redirects me to the shopping cart but nothing is being added to the cart and I do not know why.

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo Mage::getUrl('checkout/cart/add/')?>product/<?php echo $_product->getId() ?>/')"><?php echo $this->__('Add to Cart') ?></button>

This is my full block of code for the products to be displayed in my cart after some changes:

<?php if (Mage::helper('checkout/cart')->getQuote()->getSubtotal() < 75.00)
{?>

<?php echo 'We see your subtotal is under £75, why not add these products to qualify for Free Delivery';?>

<?php

$categoryid = 1054;

$category = new Mage_Catalog_Model_Category();
$category->load($categoryid);
$collection = $category->getProductCollection();
$collection->addAttributeToSelect('*');

$collection->getSelect()->order(new Zend_Db_Expr('RAND()'));
?>

<?php $i = 0; ?>

<?php foreach ($collection as $_product){ ?>

<a href="<?php echo $_product->getProductUrl() ?>">

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image'); ?>" alt="<?php echo $_product->getName(); ?>" />

<a href="<?php echo $_product->getProductUrl(); ?>">

<?php echo $_product->getName(); ?>

<?php echo Mage::helper('core')->formatPrice($_product->getPrice());?>

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product)?>')"><?php echo $this->__('Add to Cart') ?></button>

<?php if($i++ == 3) break; ?>

<?php } }

If you can help that would be appreciated.


texts:
I have run into an intermittent payment issue with a Magento 2.3.6 site and am attempting to replicate it with a PayPal sandbox account as the payment processor.
I have created the PayPal sandbox account and upgraded it to "pro" and have access to the account email and password. However, I am unable to locate where I obtain the "User" and "Vendor" information to setup the testing environment to setup the "Web Payments Pro" under the sandbox.
Does anyone have insight into where that information is available?


texts: "Interface Locale" admin language problem

texts: In my admin page, the "Interface Locale" dropdown is not working. I already switched the default language to German, but is still shows English. The same with Chinese. How can I solve this problem?


texts: How to delete (null) product attribute in this case special_price

texts:
Hi tried multiple ways in Magento 2.1

$m2Product->setCustomAttribute('special_price',null)
$m2Product->getCustomAttribute('special_price')->setValue(5);
$m2Product->setData('special_price');
$m2Product->setData('special_price', null);

$m2Product->save();

Nothing works

thank's


texts: Free Shipping rule is not getting applied via Promotions. On one-step checkout page or cart page.


texts:
I have created a custom customer attribute using the following code:

<?php

namespace MyNamespace\AccountActivated\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Config;
use Magento\Customer\Model\Customer;

class InstallData implements InstallDataInterface
{
private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory, Config $eavConfig)
{
    $this->eavSetupFactory = $eavSetupFactory;
    $this->eavConfig       = $eavConfig;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
        \Magento\Customer\Model\Customer::ENTITY,
        'account_activated',
            [
            'type'         => 'int',
            'label'        => 'Account Activated',
            'input'        => 'boolean',
            'required'     => false,
            'visible'      => true,
            'user_defined' => true,
            'position'     => 999,
            'system'       => 0,
            ]
        );
        $accountActivated = $this->eavConfig->getAttribute(Customer::ENTITY, 'account_activated');

        // more used_in_forms ['adminhtml_checkout','adminhtml_customer','adminhtml_customer_address','customer_account_edit','customer_address_edit','customer_register_address']
        $accountActivated->setData(
        'used_in_forms',
        ['adminhtml_customer', 'customer_account_edit', 'customer_register_address']

    );
        $accountActivated->save();
    }
}

The attribute appears in the database, and in the appropriate forms on the frontend. However, no values are saved in the backend. From watching one of Max Pronko's videos I added the following in etc/extension_attributes.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\CustomerExtensionInterface">
    <attribute code="account_activated" type="string"/>
    </extension_attributes>
</config>

What have I done wrong?


texts: After import: Can not view order: The requested Payment Method is not available

texts:
I imported some orders from another store. Some of them I can not view in backend because the payment method is not installed in the new shop.

How can I view the orders without installing the missing payment method?

Some ideas?


texts:
Is any one having tried to create REST API so using custom API one can trigger re-indexing?

which method do i have to mention in webapi.xml file as this is purely AREA::ADMIN activitiy. currently tried with POST (create) and PUT (Update).
Below is the webapi.xml

<route url="/V1/customapi" method="POST">
        <service class="Sark\CustomApi\Api\CustomRepositoryInterface" method="create"/>
        <resources>
             <resource ref="self"/>
        </resources>
    </route>

Further, for controller do i have to create API folder and interface mandatory or it is optional.

Index pro-grammatically code is as follows:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $indexerCollectionFactory = $objectManager->get("\Magento\Indexer\Model\Indexer\CollectionFactory");
    $indexerFactory = $objectManager->get("\Magento\Indexer\Model\IndexerFactory");

    $indexerCollection = $indexerCollectionFactory->create();
    $allIds = $indexerCollection->getAllIds();
    foreach ($allIds as $id) {
        $indexer = $indexerFactory->create()->load($id);
        $indexer->reindexAll();
    }

It would be good if any other API is also there to do the same magic (except the direct custom script file).

Ref.: http://codetheatres.com/magento/creating-custom-api-in-magento2-using-rest-protocol/


texts: Migration to Magento 2.2.5: Customer Unable to login and Create account from frontend

texts:
On migration to magento2.2.5 from magento 1.9.1.0
on login redirecting on same login page and on creating account also redirecting on same create account page. I have deleted generated, pub/static/frontend ,cleared cache and run all the commands. Please suggest what should I do to login and create a account ?


texts: Initial Form Key not Matching with Varnish/Turpentine in Firefox

texts:
I'm running into a weird issue with Varnish, Turpentine, and Firefox which is, in all likelihood, something very specific to the configuration of the system I'm working on.  I'm asking about it here mainly to cover my bases and make sure there isn't some known science out there.

The Problem: When a user first navigates to the Magento site, then navigates a catalog listing page, and clicks the "add to cart" button from this page (which triggers a GET request to the Checkout Cart controller), their product is not added to the cart.  Instead the page the user ends up on is the empty cart page.

Maddeningly, if they navigate to the catalog listing page again and click the "add to cart" button again, the product is added.

I've tracked this down to a form key problem.  The first add to cart request is ignored because of a form key mismatch.  I'm starting down the "investigate the ESI include form key implementation" road, but the whole "works fine in Chrome but not Firefox" thing makes me think the problem lies elsewhere.

Has anyone else run into this problem before, or does someone who does Varnish/Turpentine work more frequently have any known places to start digging? I didn't do the initial setup on this system, so I won't have any additional context there.

Update: Did a little more digging, when I added some logging to

#File: app/code/community/Nexcessnet/Turpentine/controllers/EsiController.php
public function getFormKeyAction() {
    //
}

It seems like each ESI include on the category page is generating a unique form key and HTTP_X_VARNISH_FAKED_SESSION header.


texts: How to add product sku beside of product name in header in product edit in admin in magento 2

texts:
I want to add the SKU beside the product name in "product edit page" at the admin-side in magneto 2? i have changed in Magento\Catalog\Block\Adminhtml\Product\Edit.php here
public function getHeader()
{
    if ($this->getProduct()->getId()) {
        $header = $this->escapeHtml($this->getProduct()->getName().'#sku'.$this->getProduct()->getSku());
    } else {
        $header = __('New Product');
    }
    return $header;
}

but it is not working in magneto 2.3


texts: Google Shopping Product Expiration Date is not updated

texts:
I have implement this extension and its working good except one thing.
Products expiration date field for Google shopping is not updated while synchronizing.

I have Google a lot and found out that we need to delete and re upload all the product again which are expired, which i thing is not a good solution( Since Google takes a lot of time to review any new product)

On debugging i found that

<sc:expiration_date>2014-08-13T14:37:22.000-07:00</sc:expiration_date>

this is always sent to Google while adding or synchronizing product, but while synchronizing the value of this field is not updated and hence product expires in 30 days on Google merchant.

Is this a know issue ?
Has any faced this issue?If yes, then how it can be solved.

Thank You


texts: Determine Magento version without access to code base

texts:
Is there a way to find the version of Magento being used without having access to server sided code?

For instance, how does this plugin work

  https://chrome.google.com/webstore/detail/magento-version-check/aekpbnbbbgocohlbdpdfgghamedmplal

My thoughts are to check for LICENSE.txt or LICENSE_EE.txt.  You can at least determine CE vs EE.

You can also use the copyright year in the default styles.css to form a guess.

Does anyone else know a better way?


texts: Delete Session Files and Prevent Returning

texts:
I've already attempted to delete session files, but they come back one at a time and slowly... Huh? Can someone explain why please and help me permanently delete them please?

I can not locate them in the database as well.

I'd also like to know how to automatically remove old session files when this weird 'bug' is resolved.

Magento 2.2.4

SOLVED Turns out the garbage collector was disabled.


texts:
I am trying to add in my footer links, when a user is logged in, a link to the order history page.

This is what I added to my customer.xml file

<action method="addLink" translate="label title" module="sales">
    <label>My Orders</label>
    <url>sales/order/history/</url>
    <title>My Orders</title>
    <prepare/>
    <urlParams/>
    <position>2</position>
</action>

The link is added and displayed in the right way, but the href is not an absolute URL, it is relative and it does not bring to the right page. How can I obtain the absolute URL?


texts:
How can i get the admin session in frontend.

   $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   $adminSession = $objectManager->create('Magento\Security\Model\AdminSessionsManager');
   print_r($adminSession->getCurrentSession()->getStatus());

I tried with above script but no luck


texts: magento show products and catagories page for logged users only

texts:
magento show product detail page for logged only

In this topic its showed that how to show products view page to logged users only.

But i don't want to show all products and categories page to visitors.
i want to show only to logged in users.
Thanks


texts: Magento 2 : Admin Sidebar links do not work

texts:
After a migration of my site from one hosting service to another the sidebar links on the admin pages do not work.

The pointer hand appears when you hover over the link but the site doesn't react when you  click on any of the links 'Dashboard, Stores, System etc'. The logo above each link doesn't display correctly too.


texts: Magento 2.3 Magento 2 Testing Email Sending But Order Confirmation Email Is Not Sending

texts:
I am using magaplaza SMTP extension and i configured it correctly, Test Email Working Fine But When I place an order the order confirmation email not sending. And the Email Logs Telling me that email is sent but actually email not received.

please see the images below:

Email Logs :

Configurations:


texts: Make magento core template use my module's translation file

texts:
In an extension I'm working on, I have a layout XML added via module's config.xml. This layout has some modifications to the frontend. Some of these blocks, however, belong to Magento core modules. The templates are all showing correctly as expected.

The templates I have packaged with the module itself are using the translation files of my own module. The templates packaged with Magento core show untranslated. If I add a translation file for the respective core module, then that translation file is used & the template shows translated.

Is there a way to make Magento use my module's translation file if it can't find any translation files for Magento core module? Is there anything else I can do here?


texts: Multiselect column and filter disappears after changing eav_attribute backend_model

texts:
I have multislect attribute which was not saving when product edit,
After updating backend_model column in eav_attribute table with
Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend

then mutiselect values are saving, but after this attribute missing in grid column and in filtering.
Please help.


texts: How To Add A Map For Every Product View Page

texts:
I have a coffee store based shop in magento . Now i want to show the map for each coffee shop in the product view

every store has its different location for google map. any help would be very thankful and appreciable. there are different store google map store extension but i want to show on the product page and each product has its different google map location how we can do this?

I can copy a iframe google map which place in the static blog and called the static block in the view.phtml page but it is for only one product i want to call different maps based on different product