texts:
How to redirect to module/controller/action when I'm inside an observer method? I need to redirect to myrouter/adminhtml_test/validate.
Why I need this:
I try to fire my controller's action which has to perform some additional calculations after "Save Config" was clicked in System -> Configuration -> Mysection. I registered observer for the event admin_system_config_changed_section_{$section}.
In my method handle_adminSystemConfigChangedSection() in Model/Observer.php I try to fire my action but it doesn't redirect to that action:
class My_Module_Model_Observer
{
    public function handle_adminSystemConfigChangedSection()
    {
        //I tried this code but it doesn't trigger the action:
        $url = Mage::helper('adminhtml')->getUrl("myrouter/adminhtml_test/validate");
        Mage::log($url); //To check if URL is correct (and it is correct)
        Mage::app()->getResponse()->setRedirect($url);
    }
}

Observer method and controller work fine (below are configuration details). I replaced the observer method with this code (from Magento forum) using header() and it works:
public function handle_adminSystemConfigChangedSection()
{
    $url = Mage::helper('adminhtml')->getUrl("myrouter/adminhtml_test/validate");
    Mage::log($url);
    header( 'Location: ' . $url );
    exit();
}

But this doesn't seem to be a correct way of redirecting to an action. How it should be done?
Configuration details:
Observer and router configuration in config.xml:
<config>
...
    <global>
        ...
        <events>
            <admin_system_config_changed_section_mysection>
                <observers>
                    <mymodule>
                        <type>singleton</type>
                        <class>mymodule/observer</class>
                        <method>handle_adminSystemConfigChangedSection</method>
                    </mymodule>
                </observers>
            </admin_system_config_changed_section_mysection>
        </events>
    </global>
    <admin>
        <routers>
            <mymodule>
                <use>admin</use>
                <args>
                    <module>My_Module</module>
                    <frontName>myrouter</frontName>
                </args>
            </mymodule>
        </routers>
    </admin>
...
</config>

Controller in controllers/Adminhtml/TestController.php:
class My_Module_Adminhtml_TestController extends Mage_Adminhtml_Controller_Action
{
    public function validateAction()
    {
        Mage::log('Test: action is working!'); //To check if action is working
        //do something here...
    }
}


texts: Magento2: How to add custom filter in categories / product

texts:
Is it possible to add a custom option to sort products in catalog -> categories -> [edit category) ---> tab: products?

I need to display here an additional attribute category_path. Is there any solution?

https://prnt.sc/rzbxx3


texts: At layered navigation need scroller in magento

texts:
We have color option for attribute , it is display at left layered navigation.
i want to display only 10 , after that need scroler for remaining .
i see in other site ..
for these have setting in admin side .
please suggest me .


texts: Magento 2 : how to show custom shipping address in email template?

texts:
I am trying to send & show custom shipping address on email template
here is the code
            $ship_country_id = "US";
            $ship_region_id = "CA";
            $ship_region = "12";
            $ship_street = "780 N. Yup Tea";
            $ship_city = "Los Angeles, California";
            $ship_postcode = "9001";

                $ship_firstName = $email_pickup_data['pickupName'];
                $ship_lastName = "";
                $ship_telephone   = $email_pickup_data['pickupPhone'];
                $sales_la_order_address_ship = array(
                    'region_id' => $ship_region_id,
                    'region' => $ship_region,
                    'postcode' => $ship_postcode,
                    'street' => $ship_street,
                    'city' => $ship_city,
                    'telephone' => $ship_telephone,
                    'country_id' => $ship_country_id,
                    'address_type' => 'shipping',
                    'firstname' => $ship_firstName,
                    'lastname' => $ship_lastName,
                    'middlename' => "",
                    'email' => "",
                    'fax' => "",
                    'status' => 0,
                    'pickupPhone' =>$email_pickup_data['pickupPhone']
                );

            $transport['la_pickup_address'] = $sales_la_order_address_ship;
            $transportObject = new DataObject($transport);

But in email template when i use {{ var la_pickup_address }} it shows error
Any thoughts on this ?
Thankyou


texts: Fresh Install of 2.0, Nothing is showing, menu or products

texts:
So i don't understand what is going on.  I have added categories, product and added widgets to the home page.  But nothing is showing up.

No Menu,
No Products,
No Categories,
No Widgets

Currently have a single store setup, (tried both with no avail), everything is active and enabled. The categories are setup as anchor. Flushed cache. Reloaded page. Flushed local cache. It really shouldn't be this hard to figure out.

I don't know what else to do in order to make this work.

Any ideas?

Thanks
-C


texts: Magento 2.3 - Paypal - Other Paypal Payment Solution - Payments Pro - keep loading at checkout page - CC Payment

texts:
After configuring Paypal Payments Pro, direct PayPal payment mode working, if pay using CC page keep loading, and my console network,

Log error : cannot be accessed with GET method (Magento\Paypal\Controller\Transparent\Response)
Response.php => https://justpaste.it/5kot8
Payments Pro Setup :

How to set up in the right way?


texts: Magento 2 how to show custom block before product.info.details and after media

texts:
Magento 2.3.5-p2 how to show custom block before product.info.details and after media ?

 **//we want to show custom block section here**

I am trying like that
 <referenceContainer name="main">
            <container name="custom.info" htmlTag="div" htmlClass="custom_block" />
        </referenceContainer>
        <block class="Custim\Block\Block\Custom" name="product_page_custom"  template="custom.phtml" />
        <move element="product_page_custom" destination="custom.info" before="catalog.product.related"/>

it is creating a new section after product.info.details(after upsell)

Does anyone know how to do it?


texts:
I've spent all day trying to debug this.

system.log error stack:

[2016-11-16 16:37:18] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_2999a55d7d9f00b9a016b5e16762ce70a and handles default, customer_account_login: Please correct the XML data and try again.  [] []
[2016-11-16 16:37:19] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_20a98983867a1770682b48d9a0ad63441 and handles 1column: Please correct the XML data and try again.  [] []
[2016-11-16 16:37:19] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-11-16 16:37:19] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-11-16 16:37:19] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-11-16 16:37:19] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_26f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again.  [] []
[2016-11-16 16:37:20] main.CRITICAL: Invalid template file: 'google/button.phtml' in module: 'Inchoo_SocialConnect' block's name: 'inchoo_socialconnect_login_google_button' [] []
[2016-11-16 16:37:20] main.CRITICAL: Invalid template file: 'facebook/button.phtml' in module: 'Inchoo_SocialConnect' block's name: 'inchoo_socialconnect_login_facebook_button' [] []
[2016-11-16 16:37:20] main.CRITICAL: Invalid template file: 'twitter/button.phtml' in module: 'Inchoo_SocialConnect' block's name: 'inchoo_socialconnect_login_twitter_button' [] []
[2016-11-16 16:37:20] main.CRITICAL: Invalid template file: 'pixelpin/button.phtml' in module: 'Inchoo_SocialConnect' block's name: 'inchoo_socialconnect_login_pixelpin_button' [] []

snippet of customer_account_login.xml:

        <referenceContainer name="customer.login.container">
        <block class="Inchoo\SocialConnect\Block\Login" name="inchoo_socialconnect_login" template="Inchoo_SocialConnect::login.phtml">
            <block class="Inchoo\SocialConnect\Block\Google\Button" name="inchoo_socialconnect_login_google_button" template="Inchoo_SocialConnect::google/button.phtml"/>
            <block class="Inchoo\SocialConnect\Block\Facebook\Button" name="inchoo_socialconnect_login_facebook_button" template="Inchoo_SocialConnect::facebook/button.phtml"/>
            <block class="Inchoo\SocialConnect\Block\Twitter\Button" name="inchoo_socialconnect_login_twitter_button" template="Inchoo_SocialConnect::twitter/button.phtml"/>
            <block class="Inchoo\SocialConnect\Block\Pixelpin\Button" name="inchoo_socialconnect_login_pixelpin_button" template="Inchoo_SocialConnect::pixelpin/button.phtml"/>
        </block>
        </referenceContainer>

pixelpin/button.phtml:

            <a href="<?php echo $this->escapeUrl($this->_getButtonUrl()); ?>"><?php echo $this->_getButtonText(); ?>

snippet of login.phtml where pixelpin/button.phtml gets called:

<?php if($this->_pixelpinEnabled()): ?>
            <div class="<?php echo $this->_getButtCol(); ?> inchoo-socialconnect-login-lower-pixelpin">

                    <?php echo $block->getBlockHtml('inchoo_socialconnect_login_pixelpin_button'); ?>

file structure:

if you need any more information just ask


texts: Magento 2: addAttributeToFilter not returning any results

texts:
When I use addAttributeToFilter on Magento\Catalog\Model\ResourceModel\Product\CollectionFactory, with a custom attribute, I always get 0 results.

use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Catalog\Model\ProductRepository;
use Magento\Framework\Api\SearchCriteriaBuilder;

...

$collection = $this->productCollection->create()
            ->addAttributeToSelect(array('custom_attribute','sku'))
            ->addAttributeToFilter('custom_attribute',['lt' => 1]);
        }

echo count($collection); //Returns 0

I also tried to use the search criteria object as Konrad Siamro sugested:

$search_criteria = $this->searchCriteriaBuilder
                ->addFilter('custom_attribute', 1, 'lt')
                ->create();
            $collection = $this->productRepository->getList($search_criteria);

echo $collection->getTotalCount(); //returns 0

But the results are the same. It works fine if I filter on a SKU, but my custom attribute returns nothing. I also tried adding the attribute to the flat product database and re indexing.

Update: Added code I used to create the attribute:

$eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'custom_attribute',
        [
            'type' => 'int',
            'backend' => '',
            'frontend' => '',
            'frontend_class' => 'validate-digits',
            'label' => 'Custom Attribute',
            'input' => 'text',
            'class' => 'class',
            'source' => '',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => '',
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => true,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]
    );


texts: Adding a custom attribute to alternate admin (order detail view)

texts:
I'm using SNM Mobile Admin to scan and add stock, and I've added a custom attribute called location_shelf, like this:

            <?php echo $this->__('Locatiecode') ?>
                         <?php $_product = $this->getProduct(); ?>
            <input type="text" name="product[location_shelf]" id="product[location_shelf]" value="<?php echo $_product->getLocationShelf();?>"/>

It shows perfectly when I scan a product.
Now I want to do the same with the order-details page, but it just doesn't show up. The only things that works is:

    <?php $model = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('location_shelf')

->addAttributeToFilter('entity_id',32)
->getFirstItem();?>

<?php echo $model->getLocationShelf();?>

It only shows one location ofcourse, but editing this piece always leads to an error.

The module's original order view code is based on  Mage_Sales_Model_Order
And uses $_order = $this->getOrder();
and

<?php $_items = $_order->getItemsCollection();?>

to get all the product info. Is there a way to show my custom attribute somewhere in here?

<?php echo $_item->getLocationShelf();?>

doesn't work unfortunately

The errors I get are like this: Call to a member function getLocationShelf() on a non-object

Thanks in advance!


texts: Getting Null on Quote Collection by Reserved Order Id

texts:
I am trying to get quote data By

  reserved_order_id

I tried this code

protected $_quoteFactory;

public function __construct(
    \Magento\Quote\Model\ResourceModel\Quote\CollectionFactory $quoteFactory
) {
    $this->_quoteFactory           = $quoteFactory;

}
public function execute(Observer $observer)
    {
         $quote = $this->_quoteFactory->create()->addFieldToFilter('reserved_order_id', $orderId);
         $quote = $this->_quoteFactory->create()->addFieldToFilter('entity_id', 12);
        $quote = $this->_quoteFactory->create()->addFieldToFilter('base_subtotal_with_discount', 20.0000);
}

the first filter is returning null while entity_id and base_subtotal_with_discount is returning me the correct result

I tried all of them separately


texts: What's the purpose of the modifyMeta() function in ModifierInterface

texts:
I've been trying to add data to the product form.   I've been following this tutorial, as well as looking through the Magento 2 codebase.

My understanding so far:

The purpose of the product_form.xml is to build the actual HTML form.
The purpose of AbstractModifier::modifyData is to add your data to the product that is passed to the form

However, I don't understand AbstractModifier::modifyMeta.  It appears to be doing the same thing as the XML, just in a hard-to-read way.  However, every module that I look at seems to modify the meta this way as opposed to putting it in XML.

What is this "meta" we are modifying, and why isn't all of this data where data belongs (XML)?


texts: Requested product doesn't exist Magento 2.1.8 after migration

texts:
I have migrated data from Magento 1.9 to Magento 2.1.8. Almost all products working fine except some products are displayed in the frontend but when I will edit one product in admin than its showing me "Requested product doesn't exist" error.

Only some products have this issue?

Can you please help me to resolve this issue?


texts: How to increase first time loading speed of Magento 2 site?

texts:
I have applied many many ways but some minor increased speed.

Thanks in advance.


texts: Frontend Cannot login after SSL installed

texts: We installed SSL and got the https:// working on our magento 1.9.2 site however we can only login once when we clear our cookies. We can not logout and then log back in again...When we press login it just goes back to the same login page again...unless we clear our cookies and reset the browser.   We tried adding the form_key after  to both the customer and peristent login files but its still not working. Does anyone have any ideas?


texts:
I have small problem. I have created my own module at local, I'd like to add logs for save/edit/delete actions with Enterprise Logging module.

I have created logging.xml at etc dir

app/code/local/AB/Characteristic/etc

<logging>
<characteristic translate="label">
    <label>Characteristics</label>
    <expected_models>
        <characteristic__characteristic />
    </expected_models>
    <actions>
        <characteristic_adminhtml_characteristic_save>
            <action>save</action>
        </characteristic_adminhtml_characteristic_save>
    </actions>
</characteristic></logging>

What I am doing wrong? Nothing save at /admin/logging/.


texts: How to make text function as clickable link in admin HTML / backend grid

texts:
I've created a custom extension that utilizes a grid to display a table of records. Inside those records there is a column known as link which contains a hyperlink to a specific webpage.

Currently I'm displaying this piece of text information with the following code inside of my grid.php extension file:

  $this->addColumn('link', array(
      'header'    => Mage::helper('myextension')->__('Link'),
      'align'     =>'left',
      'index'     => 'link',
  ));

It would pull whatever the user input into the custom form (e.g. "http://website.com"). All I want to do - inside of my grid.php file using the code above - is to wrap it the necessary code to make it render as a clickable link.

Render before:

Link

I tried concatenation which didn't work:

  $this->addColumn('link', ' Mage::helper('myextension')->__('Link'),
      'align'     =>'left',
      'index'     => 'link',
  ) . '">Link');

Any ideas?

Additional Notes: It is in fact an external link.


texts: How to add a category to the breadcrumbs?

texts:
I wanted to add a static text with a link in front of my category page and product page breadcrumbs.

Existing Breadcrumbs:

Home > Category > Sub Category > Sub Category

How I want it to be

Home > Static Text with link > Category > Sub Category > Sub Category

Remember, my cms pages breadcrumbs need to remain as they are. Not like above.


texts: Filtering works on search page and doesn't on category product list

texts:
I am working on a Magento store and edit the code of another programmer. Now I runned in a problem. Filtering from layered navigation works on the search page and doesn't work on the page with products of a category.

Description:
Let's say I have category Shoes, with the attribute Color. 2 Products

Allure A302M, white color
Allure 212M, black color

If I search Allure, it finds those products. When filtering white color it finds A302M model. So Filter on search works. Now if I open category shoes and choose white color, filtering doesn't work, it find all shoes.

I found a custom module in code/local and removed it, but no change. What can be the problem? Maybe attribute configuration is wrong?

Configuration:


texts: Find entity_id & attribute_id of an attribute

texts:
We need to convert a dropdown attribute to multiselect

I found a way here :

If attribute_code : age ,
entity_type_id = 10 ,
store_id = 1

UPDATE eav_attribute SET
entity_type_id = '10',
attribute_model = NULL,
backend_model = 'eav/entity_attribute_backend_array',
backend_type = 'varchar',
backend_table = NULL,
frontend_model = NULL,
frontend_input = 'multiselect',
frontend_class = NULL
WHERE attribute_id = 'age';

Next, copy the attribute values from the old table to the new:

INSERT INTO catalog_product_entity_varchar ( 10, attribute_id, 1, entity_id, value)
SELECT entity_type_id, attribute_id, 1, entity_id, value
FROM catalog_product_entity_int
WHERE attribute_id = age;

Finally,  remove the old values or they will conflict with the new setup (the old values will load, but Magento will save new values to the varchar table):

DELETE FROM catalog_product_entity_int
WHERE entity_type_id = 10 and attribute_id = age;

Credits :

http://swarminglabs.com/how-to-change-a-product-dropdown-attribute-to-a-multi-select/

but here i want to know how to find "attribute_id and entity_id" for an attribute. so i can replace those values in above queries


texts: Incorrect dependency ScopeConfigInterface already exists in context object in compilation of magento2

texts:
<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Ortho\Featuredproduct\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
/**
 * Search helper
 */
class Data extends AbstractHelper
{

   /** * @var \Magento\Framework\App\Config\ScopeConfigInterfac */
    protected $_scopeConfig;
    protected $_config;
    protected $_storeManager;
    protected $_productFactory;
    CONST FEATURED_ENABLE = 'featured_settings/general/isenable';
    CONST FEATURED_TITLE = 'featured_settings/general/title';
    CONST FEATURED_LIMIT = 'featured_settings/general/limit';
    CONST FEATURED_SIDEENABLE = 'featured_settings/general/isleftenable';
    CONST FEATURED_SIDELIMIT = 'featured_settings/general/sidebarlimit';
    CONST FEATURED_METATITLE = 'featured_settings/featured_metadata/meta_title';
    CONST FEATURED_METAKEYWORD = 'featured_settings/featured_metadata/meta_keyword';
    CONST FEATURED_MTEADESC = 'featured_settings/featured_metadata/meta_description';

    /**
     * Initialize
     *
     * @param Magento\Framework\App\Helper\Context $context
     * @param Magento\Catalog\Model\ProductFactory $productFactory
     * @param Magento\Store\Model\StoreManagerInterface $storeManager
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Catalog\Model\ProductFactory $productFactory,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        array $data = []
    ) {
        $this->_productFactory = $productFactory;
        $this->_storeManager = $storeManager;
        $this->_scopeConfig = $scopeConfig;
        parent::__construct($context, $data);
    }

    public function getFeaturedstatus()
    {
        return $this->_scopeConfig->getValue(self::FEATURED_ENABLE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getFeaturedlimit()
    {
        return $this->_scopeConfig->getValue(self::FEATURED_LIMIT,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getFeaturedTitle()
    {
        ///echo 'check';
        return $this->_scopeConfig->getValue(self::FEATURED_TITLE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getFeaturedleftstatus()
    {
        return $this->_scopeConfig->getValue(self::FEATURED_SIDEENABLE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getFeaturedleftlimit()
    {
        return $this->_scopeConfig->getValue(self::FEATURED_SIDELIMIT,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getMetaTitle()
    {
        return $this->_scopeConfig->getValue(self::FEATURED_METATITLE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getMetaKeyword()
    {
        return $this->_scopeConfig->getValue(self::FEATURED_METAKEYWORD,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getMetaDescription()
    {
        return $this->_scopeConfig->getValue(self::FEATURED_MTEADESC,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function getBreadcrumbs(\Magento\Framework\View\Result\Page $resultPage) {

        ///echo 'check breadcumbs';
        $breadcrumbs = $resultPage->getLayout()->getBlock('breadcrumbs');

        $breadcrumbs->addCrumb(
             'home', [
            'label' => __('Home'),
            'title' => __('Home Page'),
            'link' => $this->_storeManager->getStore()->getBaseUrl()
                ]
        );
        $breadcrumbs->addCrumb(
                'cms_page', ['label' => __('Featured Product'), 'title' => __('Featured Product')]
        );
    }
}


texts: EE 1.13.1 Url Rewrites Not Working.. Why will they not index?

texts:
This is a clean install of EE 1.13.1 not an upgraded site.

I am facing this issue with a group of skus in my catalog...

  www.MYSITE.com/catalog/product/view/id/189576/s/**url-key**/category/293/

I have checked the rewrite tables for this and there are no rewrites for it. It is as if it is keeping that url, and will not index it to a clean url.

Secondly there are products like this:

  www.mysite.com/catalog/product/view/id/188662

(same product, both urls work)
This once again has a valid URL key that is not a duplicate, and yet can not index. Why?


texts:
During the check out process after filling the billing section, and trying to go to the Shipping section with the option "Ship to this address" I can not proceed, as I am able to go to the shipping section with the option "Ship to different address".

The console shows the following errors:

form.js:178 Uncaught TypeError: Cannot read property 'options' of null
    at klass.initialize (form.js:178)
    at klass (prototype.js:101)
    at (index):2112

form.js:178 Uncaught TypeError: Cannot read property 'options' of null
    at klass.initialize (form.js:178)
    at klass (prototype.js:101)
    at (index):2237


texts:
<?php
    require_once "app/Mage.php";
    Mage::app('default');
    umask(0);
    Mage::getSingleton('core/session', array('name' => 'frontend'));

    $session = Mage::getSingleton('customer/session');

$session->start();

            if (!empty($email) && !empty($password )) {
                    try {
                        $session->login($email, $password );
                        if ($session->getCustomer()->getIsJustConfirmed()) {
                            $this->_welcomeCustomer($session->getCustomer(), true);
                        }
                    } catch (Mage_Core_Exception $e) {
                        switch ($e->getCode()) {
                            case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:
                                $value = Mage::helper('customer')->getEmailConfirmationUrl($email);
                                $message = Mage::helper('customer')->__('This account is not confirmed. Click here to resend confirmation email.', $value);
                                break;
                            case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD:
                                $message = $e->getMessage();
                                break;
                            default:
                                $message = $e->getMessage();
                        }
                        $session->addError($message);
                        $session->setUsername($email);
                    } catch (Exception $e) {
                        // Mage::logException($e); // PA DSS violation: this exception log can disclose customer password
                    }
                } else {
                    $session->addError('Login and password are required.');

   }
?>

I am trying to programmatically login,it is successful but in product details page I get an error like this:

  WHOOPS, OUR BAD... The page you requested was not found, and we have a
  fine guess why. If you typed the URL directly, please make sure the
  spelling is correct. If you clicked on a link to get here, the link is
  outdated.


texts:
Scenario:

=>I am using one custom page as custom-router in magento2 to redirect between 3 pages "Page1,page2,page3" according to value of $currentPage variable, saved in session.

=>These three pages has two buttons to change the current page and it will change value of $currentPage variable.

Behaviour:

if user is on page2 and ofcourse value of $currentPage is page2. And user tries to open page3 in newtab(browser). The custom router is redirecting user to page2.

Question/Problem

This routing method is wrong on magento2? If yes then what should be correct approach?
Can we use magento urlrewrite functionality in this case? If yes then how can we check the $currentPage variable value?
It's affecting the page loading time of the pages. How can we avoid that?


texts: Related Products, Up-Sells, and Cross-Sells modal panel error

texts:
After moving to Magento ver. 2.2.2 from Magento var. 2.1.9 the Related Products, Up-Sells, and Cross-Sells modal panel from catalog product edit doesn't show anymore.
I can see these error in the console

Uncaught TypeError: Cannot read property 'apply' of undefined
at registry.js:59
at Registry._resolveRequest (registry.js:418)
at Registry._addRequest (registry.js:385)
at Registry.get (registry.js:229)
at async (registry.js:58)
at UiClass.applyAction (button.js:78)
at Array.forEach (<anonymous>)
at UiClass.action (button.js:56)
at HTMLButtonElement.<anonymous> (knockout.js:3863)
at HTMLButtonElement.dispatch (jquery.js:5226)

After many debugging hours I found the KO component applied to product_form.product_form.related.related.modal is Magento_Ui/js/form/form instead of Magento_Ui/js/modal/modal-component

Can anyone help or point me in the right direction to fix it?


texts: Account type not visible in Google API> Google Analytics configuration page Magento 2

texts:
I'm trying to set up Universal Analytics through Google Tag Manager in Magento 2.3.2.
I follow the official doc, or other tutorials, but in my backend, when I go to Store>Sales>Google API>Google Analytics and enable it, I have no dropdown Account Type. Any idea what I am missing ?


texts: Missing commands for Magento command line

texts:
Whenever I run the common commands I get this and similarly named errors:

    [Symfony\Component\Console\Exception\CommandNotFoundException]
  There are no commands defined in the "deploy:mode" namespace.

Im using Magento 2.2.5


texts:
I'm trying to create very simple form(just one text input) and add a fieldset with insertListing component(Magento_Ui/view/base/web/js/form/components/insert-listing.js). Component that is responsible for adding related/upsell and crossell products in product form.

For simplicity i copied the form modifier from catalog Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related to my form (with minor tweaks like form name change to make it work)

This all works well. I see the fieldset, I can open the insertListing, select products, reopen the listing (and I see previously selected product). However the dynamic-rows-grid component that should display the selected products is empty, it never gets populated from the listing.

When I inspect the data source for the form I see that insertListing creates data in different part of the source than the dynamic rows reads from. It creates data within the type_form.type_form_data_source.data instead of type_form.type_form_data_source.

I'm however not sure how to fix this. The code looks the same as product form, looking into the generated json for the form it also looks the same. Please see the generated json:

pastebin link

Can anybody with more experience with ui components spot my mistake or point me into right direction?

Thank you


texts: Wysiwyg custom attribute with cms directives is not working

texts:
I have a wysiwyg custom attribute.

Insert an image there:

But in the html code source I see this one:

Instead of

This html source is generated by this code:

<?php echo $_item->getPreview() ?>

Why wysiwyg cms directive was not replaced with image url?


texts: How do I sort Magento products in a specific category according to my order

texts:
I want to sort Magento products on a list page for a specific category according to my given order. Can I have a text field in each product and give any number and my products in that specific category will sort according to it in ascending or descending.

I have tried Magento default sorting. I have added for about 5000+ products in different categories and I want to sort them according to my sort order.

Please tell me the possible solution?


texts: How to get cart subtotal without tax in Magento 2?

texts: How can I retrieve the cart subtotal without tax in Magento 2?


texts: Maximum PHP function nesting level error of NewRelic after turn off cache

texts:
When I turn off the cache in Magento I get error from Magento in de Frontend in the Backend I get no error message.

  Fatal error: Aborting! The New Relic imposed maximum PHP function nesting level of '5000' has been reached. This limit is to prevent the PHP execution from catastrophically running out of C-stack frames. If you think this limit is too small, adjust the value of the setting newrelic.special.max_nesting_level in the newrelic.ini file, and restart php. Please file a ticket at https://support.newrelic.com if you need further assistance. in /data/web/public/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 861

Also when I connecting to the API and SoapUI I get the error.


texts: How to add image url and description to Magento 2 Rest API “rest/V1/categories”?

texts:
in magento 2.1:

Categories Rest api "rest/V1/categories" returns data as follows

 {
"id": 41,
          "parent_id": 3,
          "name": "Bakery",
          "is_active": true,
          "position": 4,
          "level": 2,
          "product_count": 0,
    "children_data": [],
}

how to modify it to return the category image and description ?


texts:
I am looking to something similar to this one (thats works with email), But instead of get the customer by email, i want to get him by the  Tax/VAT number.

$customer = Mage::getModel('customer/customer')->setWebsiteId($website->getWebsiteId())->loadByEmail($customerEmail);

I found this example but  its doesn't work.

$customer = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')->addFieldToFilter('taxvat',  $ss_5_last)->load();

Thank you.


texts: how to override the product controller in admin panel

texts:
how to override the catalog/product/new action, but I am not understanding where I start. I have searched on different forums but I couldn't get any idea.
I have tried it by overriding the copy in local but could not succeed.


texts:
I have dedicated server with multiple magento installations e.g
1.Production
2.Dev
3.Blogs
all magento installations are set up under separate secondary domains. However production has a dedicated IP and all other installations are on separate IP address.

What is the best way to set up git? should I install it in root to controll all files in one repo or it's better to set up separate repos in each installation?

Thanks.


texts: Magento2 : Best way to handle Multi Device login using REST API Auth

texts:
I am creating an auth token for mobile customer using

  /V1/integration/customer/token

When I use the same customer credentials in Second mobile device the first auth token is invalidated as the when requesting again it overwrites token for that customer

What the best way to get around it , i started with introducing as deviceId column that table and overwriting only in case when customer id and device Id matches . Is there any better approach


texts: Can Magento be configured to use discounted Fedex rates without code-level changes

texts:
Trying to figure out why, by default, the Fedex rates that are returned are not the discounted rates that we're expecting.  Found a good post on the Magento forums relevant to this:
http://www.magentocommerce.com/boards/forum/viewthread/303546/#t473550

They referenced a Magento bug report that I couldn't find:
Issue #14644

I'm currently on Enterprise 1.12.0.2 (I know I know, behind 2 major point versions.  If it turns out this issue is due to be being behind, that will be a first).

Perhaps it's just that by default they expect merchants to charge their customers list price and keep the savings for themselves.  That wouldn't be completely unreasonable.  But it's surprising that there isn't at least a configuration option for this.

UPDATE: I noticed that I got a downvote and close vote.  While this question may in part relate to a business decision that's outside the scope of a proper SO question, I think that this is still a useful question to have a cannonical answer.

After a decent bit of searching, I wasn't able to figure out why my rates were incorrect and Fedex developer support is, let's just say, not very helpful.

So, if for no other reason than to give other people a quick answer to why their rates are incorrect, I think this is a useful question to have around.

In order to make the question less subjective, I've changed it from "why don't..." to "Can Magento be configured to use discounted rates without code-level changes?".


texts: Magento 2: How to set Max Length for Street Address?

texts:
I would like to set Max Length for Customer's Street Address 1 to 50 Characters & Street Address 2 to 100 Characters.

Changes will be applied on Frontend only, where we can find Street Address.

Last is to override page.

How to achieve this?


texts: Magento\Vault\Api\Data\PaymentTokenInterfaceFactory throws an exception during Checkout

texts:
I'm using the theme -

  https://themeforest.net/item/multistores-magento-2-megashop-theme-support-multiple-stores/19211690?s_rank=17

I purchased the theme from themeforest and had the application set up on a hosting. I'm using Magento ver. 2.1.1. After adding products into the shopping cart, when I clicked checkout, it threw an exception:

Cannot instantiate interface Magento\Vault\Api\Data\PaymentTokenInterfaceFactory in /home/shopegiv/public_html/dev/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

I tried to resolve the same by putting this line in app/etc/di.xml:

< preference for="Magento\Vault\Api\Data\PaymentTokenInterfaceFactory" type="Magento\Framework\ObjectManager\Factory\Dynamic\Developer" />

Thereafter, the fatal error went away, but now I get the following error in var/log/system.log:

  Argument 15 passed to
  Magento\Paypal\Model\Payflow\Transparent::__construct() must implement
  interface Magento\Vault\Api\Data\PaymentTokenInterfaceIFactory,

  instance of Magento\Framework\ObjectManager\Factory\Dynamic\Developer
  given, called in
  /home/shopegiv/public_html/dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php

  on line 93 and defined in
  /home/shopegiv/public_html/dev/vendor/magento/module-paypal/Model/Payflow/Transparent.php
  on line 99 [] []

The output displayed on the screen was Object DOMDocument should be created.

I assume I'm not going the right direction to specify the preference or specify concrete factory such as AccountPaymentTokenFactory or CreditCardTokenFactory.

If someone could advice the workarounds split into steps, I shall be thankful.

I would greatly appreciate any help on this.


texts: When caching is on my blocks appear on all pages instead of specific pages

texts:
love to get some help on this one as I'm stuck!

I have created some phtml files under app\design\frontend\mytheme\default\template\mytheme\

These phtml files pull data from static blocks in the backend using

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('my_static_block')->toHtml(); ?>

I then call the phtml files in my local.xml file e.g:

<catalog_product_view>
    <reference name="footer">
        <block type="page/html" name="my.block" template="mytheme/myblock.phtml"/>
    </reference>

Now the problem is this:

When caching is off everything works as it should and the blocks only display on the pages it should.

As soon as I enable caching the blocks then display on every page, when it shouldn't.

Any help would be appreciated!


texts: Admin config with extendable amount of fields

texts:
I want to create an admin config with "exception dates".

Since the number of these dates can vary, I cannot just put a constant number of input fields in the config.

Is there a way to automatically add more fields or have a button to add extra fields? Then perhaps collecting the values into an array...


texts: Magento 2 Product page remove fotorama slider and display all products images one by one

texts:
In Magento 2 Product page I am trying to remove fotorama slider and display all products images one by one as below screenshot. For Configurable products it should change the dynamic values for its associated products if an.

Below is the image of current Magento 1 site.

If there are any extensions available please suggest or guide.


texts: Add new column to customer group grid Magento 2

texts:
How can I add new column to customer grid ?
I have created custom module. Below is my code.

  path : vendor/module/view/adminhtml/layout/customer_group_index.xml

<body>
<referenceBlock name="adminhtml.catalog.product.set.grid.columnSet">
    <block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.customer_group_columns">
          <arguments>
               <argument name="header" xsi:type="string" translate="true">Shipping Method</argument>
               <argument name="index" xsi:type="string">shipping_method</argument>
               <argument name="default" xsi:type="string">*</argument>
          </arguments>
    </block>
</referenceBlock>
</body>


texts: How to change qty text box into dropdown in minicart place view/frontend/web/template/minicart/item/default.html file ?


texts: How to add third-party script code into our magento2 for Website tracking

texts: how to add third-party script code into our magento2 for website tracking. I don't know how to implement this task. Can you please help me?


texts: Magento 2 - Calling functions from a block from controller

texts:
Say I want to call a function from a Block while inside my Controller class which outputs on screen, how would i go about this?

Code for New/Module/Controller/Hello/World.php :

  <?php
  namespace New/Module/Controller/Hello/;
  class World extends \Magento\Framework\App\Action\Action
  {

 public function execute()
 {
    echo '<p>"Hello World"</p>';
    var_dump(__METHOD__);

    divide(10,1);  <-- trying to do this
 }
 }

Code for New/Module/Block/Calculator.php

<?php
namespace New\Module\Block;
class Calculator{
public function divide($number1, $number2)
{
return $number1/$number2;
}
public function multiply($number1,$number2){
return $number1*$number2;
}
public function add($number1,$number2){
return $number1+$number2;
}
public function sub($number1,$number2){
return $number1-$number2;
}
}

I'm attempting to create a calculator and I'm not even sure this is the best way to go about calling functions to output on screen.

Any help would be much appreciated :)


texts: Magento 2 How can i add BCC to order email with observer programatically?

texts:
I have created module and wrote one an observer on "order_place_after", here i want to send the same order email copy to my custom email address.

How can i send the same order email to my custom email address or add that email address as BCC to send order email copy?

Thanks


texts: How do I check if a product is configurable

texts:
Does someone know how to check if a product is configurable ?

I want my configurable products to say 'From:' in front of the price on the product list page.


texts: How do I approach to fixing bugs of Magento 2 code in the custom project?

texts:
For example, this bug: https://github.com/magento/magento2/issues/11211
What if I'm building a custom project, based on current Magento 2.2.0 version, and I face with this bug in it's code.

I know that it will be fixed in the upcoming release (2.2.2), however, I need the custom project fixed right now.

How do I approach to fixing this?
What comes to my mind, is to rewrite the involved Model in a custom module.

Is this the best practice to deal with this situation, or there are some smarter ways?


texts: Magento 1.9.1 Email Queue not working/buggy - how to troubleshoot and what is considered the best patch?

texts:
First of all yes, this is yet another question/topic about the 1.9.1 email queue. But it is not about about any cron problems (like this or this)  or about the new queue feature not being used (like this).

In our case we had the problem, that the queue (core_email_queue and core_email_queue_recipients) simply wouldn't get any emails on new orders or order updates and therefore no more emails got sent out for anything order related, also cron is working perfectly and manually adding emails to the queue works and they get sent out.

The strange thing is, in our test environment everything worked. Even when we went live today in the first minutes all emails got processed but after some minutes (without any further modification on the live system of course) no more new emails got added to the queue at all. It seems like this happened (but I cannot tell for sure) when the first customer used PayPal Express, which we didn't test beforehand :-/ And indeed we were using some custom overrides in the PayPal Express logic with the old sendNewOrderEmail() function. But we couldn't get emails to work again even after patching those to use queueNewOrderEmail().So the first question would be, is it possible that the old function triggered some inconsistency which 'broke' the email queue? Or is this all just a big coincidence and there is a totally different explanation?

As we couldn't find the problem but of course needed emails to work again asap we went for another core override. In Mage_Core_Model_Email_Template_Mailer (of course in a copy in local) we commented out line 76: ->setQueue($this->getQueue())This seems to bypass the queue and all mails get sent the old way again.

However, as we'd like to keep the number of core overrides to a minimum and we also cannot tell right now if we will face any other side effects, any other tips or solutions from people with a deeper understanding of the magento code and the email queue would be appreciated.

Update for 1.9.2: On the upgrade to 1.9.2 we had a closer look at the e-mail queue again and weren't able to reproduce the problem. But as we still have no real clue what the problem with 1.9.1 was and as overriding Mage_Core_Model_Email_Template_Mailer::send() still works in the here described way we still aren't using the queue. This way we hope not to run in the same problem again after some time in production.

tl;dr: The email queue isn't working in 1.9.1, commenting out line 76 in Mage_Core_Model_Email_Template_Mailer bypasses the email queue and mails get sent again but this doesn't feel like a good solution. How can this be solved better?


texts: Problem adding PDF Form upload to Magento 2.1

texts:
I am trying to create a PDF upload attached to product in Magento 2.1 I am able to get the form to display but it is not generating a field "name" which I believe is required for the form upload.

From what I understand the form field name should be "pdf" but this is not displaying when viewing the source code

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

<fieldset name="pdf_upload">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Product PDF Upload</item>
            <item name="sortOrder" xsi:type="number">999999</item>
            <item name="collapsible" xsi:type="boolean">true</item>
            <item name="opened" xsi:type="boolean">false</item>
        </item>
    </argument>

    <field name="pdf">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">string</item>
            <item name="source" xsi:type="string">product</item>

            <item name="componentType" xsi:type="string">fileUploader</item>
            <item name="label" xsi:type="string" translate="true">Select A File</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="formElement" xsi:type="string">fileUploader</item>
            <item name="required" xsi:type="boolean">false</item>
            <item name="sortOrder" xsi:type="number">40</item>
            <item name="notice" xsi:type="string" translate="true">Only PDFs are allowed</item>
            <item name="maxFileSize" xsi:type="number">209715200</item>
            <item name="allowedExtensions" xsi:type="string">pdf</item>

            <item name="uploaderConfig" xsi:type="array">
                <item name="url" xsi:type="url" path="productinformation/product_pdf/upload"/>
            </item>

        </argument>

    </field>

</fieldset>


texts: Why Order email is going to two different customers in Magento 1?

texts:
I am placing an order on my website. The order email is going to two different email. Another email is choosing randomly.

Why is this happening?
What is the issue?

http://nimb.ws/mYL6tS


texts: Magento 2 - where is method declaration of $this->getAddress() in Magento\Directory\Helper\Data line146

texts:
where is method declaration of $this->getAddress() in
https://github.com/magento/magento2/blob/develop/app/code/Magento/Directory/Helper/Data.php#L146

public function getRegionCollection()
{
    if (!$this->_regionCollection) {
        $this->_regionCollection = $this->_regCollectionFactory->create();
        $this->_regionCollection->addCountryFilter($this->getAddress()->getCountryId())->load();
    }
    return $this->_regionCollection;
}

i don't know where is method come from, but if i search "function getAddress()",
i fount it in Magento\module-customer\Block\Address\Edit
https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/Block/Address/Edit.php#L211

/**
 * Return the associated address.
 *
 * @return \Magento\Customer\Api\Data\AddressInterface
 */
public function getAddress()
{
    return $this->_address;
}

i don't think that class is related


texts: Customers are not able to register on frontend

texts:
Some time ago i posted kinda the same question, but this one is better detailed and contains the actual problem.

I got messages that customers are not able to register an account on the frontend, Im using hellowired theme, on their website i saw a fix for the problem by inserting a code, however this did not work, in of the comments on the topic someone said i should use the base login.phtml and this did not work as well.

I believe the problem is really in the login.phtml, although i can't find out where or what it is.

Anyone who can help me out here maybe? Googled the problem and only got variations of it.

Thanks in advance!


texts: Third Party JS not Working using require js Magento 2.3.2

texts:
We are trying to create new Theme in Magento2. We have a problem in executing third party js file.

requirejs-config.js file configuration

var config = {

  deps: [
    "js/default"
  ],
  paths: {
        'progress': 'js/progressively.min',
        'header': 'js/header',
    } ,
    shim: {
        'progress': {'deps': ['jquery'],'exports':'progressively'},
        'header': {'deps': ['jquery','progress']},
    }

};

I have downloaded the progreessively.min.js from the following Link
https://cdnjs.com/libraries/progressively

header.js file

require([
    'jquery',
    'js/progressively.min'
], function ($) {
    "use strict";

    progressively.init({
        onLoadComplete: function() {
            console.log('All images loaded!');
        }
    });
});

We are loading the theme and content with no errors and there is also no error in console as well but js is not working. Can you please suggest us.


texts: Can't able to implement fancybox on magento 2

texts:
I am trying to add fancybox for Youtube Videos in my store but when I click on the picture, it redirects me to youtube rather than opening a pop-up. I have tried all the solutions available on this forum but nothing worked for me.
This is my require.js file.
var config = {
    paths: {
        'fancybox': "js/jquery.fancybox.min"
    },
    shim: {
        'fancybox': {
            deps: ['jquery']
        }
    }
};

This is my .phtml file

PLAY

Here all the frontend code lies. As I said I have tried almost all solutions regarding this error, nothing worked for me.
Since I am a beginner in Magento 2.It would be helpful if you can explain what does require.js file do?


texts:
www.grizb.com

My site disappears and show cpanel page, I have done nothing,   and internal page shows 404 error, Can anyone help me what happened and what to do to make it live, site url redirect to " http://grizb.com/customer/account/login/ " but now whole site is gone.


texts: how to track number of visitors visiting the magento site using "Google analytics" or by any other solution

texts:
I want to know how many visitors are visiting the Magento site.

I found  Google API here :

  System > configuration > Sales > Google API

What next do I have to do? please guide me.

Thanks in advance.


texts:
SQLSTATE[42S02]: Base table or view not found: 1146 Table
  tradesbarn_cmestore.core_website doesn't exist

Query was:

SELECT core_website.website_id, core_website.code, core_website.name FROM core_website


texts: Magento 2 : New Order Email Template CSS Not Working in Production Mode

texts:
I am facing issue in sales new order email template. I am working with my custom theme. Problem is there, new order email template CSS working in developer mode correctly but same template not working on production mode.

Can any one have resolve this issue or know more about it.

Thanks in advance


texts: Composer update failing with Root package 'magento/project-community-edition' cannot require itself in its composer.json

texts:
If I install a completely fresh version of Magento in an empty directory, say 2.3.3, using the command:
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.4 .

Then Magneto installs fine. But if I then go to update this installation using
composer require magento/project-community-edition=2.3.4 --no-update

I get the error:
Root package 'magento/project-community-edition' cannot require itself in its composer.json

I've tried with multiple different versions of Magento, but I'm getting the same result.
The really odd thing is that this was working earlier today and has stopped working in the last couple of hours. The same thing happened yesterday. Working for some hours, then started getting the error and then when I returned to it this morning, everything working again.
I've tried on different servers and using different Magento Marketplace keys, but I'm getting the same result.


texts:
We use Akamai for our CDN on our Magento store, and I'm running into some issues where it would be nice to disable the CDN for our admin area. Does anyone know a simple way to do this?

I tried creating a custom admin URL in Configuration->Advanced->Admin->Admin Base URL, but this just locked me out of my Magento admin and I had to edit the core_config_data table to get back in.


texts: How can i display Products Position in view.html?

texts:
How can i display the products position (of the current category) in the products view.phtml?

I try

$_category->getProductsPosition()
and
$_product->getProductsPosition()

Both still won't work :(


texts: Possible causes for custom extensions working on 1.7 but not 1.9

texts:
I have a custom magento extension installed on several 1.7 sites and 1.9 sites. functionality does not work on the 1.9 sites.

What are common reasons that an extension might work on 1.7 but not on 1.9, where can I see what are the points that are influencing these incompatibilities?

Some difference for extension compatibility difference between 1.7 and 1.9 include the requirement of a form_key for any form functionality on the frontend.

Another is that blocks might need to be added under System > Appearance to be visible on the frontend.

With patch SUPEE-6788, admin routers needed to be changed.


texts: Magento 2: Rest API update multiple cart Items

texts:
I need to update multiple cart items quantity in Rest API.

Default Magento only have update single cart item.

Single cart update Item endpoint:

  /V1/carts/mine/items/:itemId

I have tried with custom endpoint but not get update multiple items.

Multiple item custom endpoint:

localhost/magento2/rest/V1/custom/carts/mine/update/items?cartItem[0][item_id]=85411&cartItem[0][qty]=2&cartItem[0][quote_id]=25645&cartItem[1][item_id]=85412&cartItem[1][qty]=1&cartItem[1][quote_id]=25645

Params:

cartItem[0][item_id]   85411
cartItem[0][qty]       2
cartItem[0][quote_id]  25645
cartItem[1][item_id]   85412
cartItem[1][qty]       1
cartItem[1][quote_id]  25645

Method: PUT

Let me know if any have idea about to update multiple cart items in rest API.

Any help would be appreciated. Thanks.


texts:
I am having problems installing my module in magento2 I copy my module to app/code and execute :

php bin/magento setup:upgrade

And then when I try to access my magento i get an empty page and nothing works after that:

But if I execute this commands as root everything works fine:

rm -rf pub/static/* var/* generated/*;
chmod 0777 var/ pub/ generated/;
chmod 0777 -R var/ generated/ pub/;
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

I don't really understand all this commands and what they exactly do, I don't want to execute something I don't understand because it's too risky.

Can someone explain to me this commands, are they safe to execute and is there a safer and simple way to install a module.

Thanks.


texts: Magento 2, Custom Customer Address Attribute update issue

texts:
I am using Magento 2 Cloud. I have created a Customer Address Attribute customer_shipping_date using Admin Menu.

This attribute is not visible on frontend.

In sales_order_save_after observer I try to set/update it's value programmitically but when I edit order address in admin, it shows blank.

How can I set the value after order has been created.

Thanks


texts: Magento 2.1.2: How to remove billing address lastname field and shipping address lastname field

texts:
In Magento 2.1.2

How to remove billing address lastname field and shipping address lastname field ?

I update to eav_attribute table.
UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname' and entity_type_id = 1;
and I removed vendor/magento/module-customer/view/frontend/templates/widget/name.phtml

The lastname is valid, but the billing address and the delivery address are invalid.

Does anyone know this ?


texts: apply more then one Shopping Cart Price Rule to one item

texts:
I have a Shopping Cart Price Rule that if a product meets a condition that it applies the rule, simple normal.  I have another rule for the same product that is set for a different condition.  The issue is that, due to the way the promotion is set up I need to let both rules be applied to the item, but what happens is that only one is applying to the item.  I have tested this out by turning one rule off, which I'll see the other be applied, and then flip it and I'll see the other active rule applied.
What needs to happen is that I need to let both be applied to the item for a combined discount.  There are like 3 versions of the rules now, and if I was to try to do all the combinations of these current rules, then I'd have like 50 rules to try to account for all the possible conditions.  Well not 50 but point is making new rules is not a clean way to deal with this.
Any ideas on how to extend the promotions so that more then one rule may apply?  Maybe a simple extension example to be clear?
update 1
It seems to me that I may want to try to extend Mage_SalesRule_Model_Resource_Rule_Collection ?  I'm still trying to find the root of where the override should take place to allow for a clean implementation to get more then one rule to apply to an item.  I know there will need to be things accounted for like the order/quote to the reports, but the thought here is that if I start at the collection, that it'll apply in all the other places.
update 2 (further inspection of the core)
I have been rooting around to find answer this question:
Where does it stop processing a discount for an item(action)?
This seems to me to be the root area where one would address the solution to the issue,  at the time of writing I believe, Mage_SalesRule_Model_Validator->process().  In there it does a
    $appliedRuleIds = array();
    foreach ($this->_getRules() as $rule) {

Which is promising in the sense that Magento is looping over all the rule on the (Mage_Sales_Model_Quote_Item_Abstract)$item and it seems that
        /* @var $rule Mage_SalesRule_Model_Rule */
        if (!$this->_canProcessRule($rule, $address)) {
            continue;
        }

        if (!$rule->getActions()->validate($item)) {
            continue;
        }

is the deciding factor, but I see nothing that indicates a check for a rule that is already applied.  At this time, it's not apparent where the "stop we already applied a rule" part is coming in.
Still running it down
I see that if I check
        if ($rule->getStopRulesProcessing()) {
            //$this->_stopFurtherRules = true;
            //break;
        }

in the Mage_SalesRule_Model_Validator->process() it will move on to the next rule, but, it seems to just over ride the next rule (I think) and it's not cumulative.  One step forward two steps back
pushing forward
It seems that maybe the issue of the cumulative discount not occurring is that the base discounts are hardcoded to 0.
        $discountAmount = 0;
        $baseDiscountAmount = 0;
        //discount for original price
        $originalDiscountAmount = 0;
        $baseOriginalDiscountAmount = 0;

Is that is in that foreach loop.  It would seem that I would want to be getting those from the item object not set as 0
side thought I ran down
So I had a thought.. what if the product in the order that has the qty of 3 (mind you this is what I'm testing) is $25 and the two discounts are $25 and $10.  What I'm thinking is that it's not that its 3*25 - 35, but it's that it was only picking up the 1 of 3 and trying to do the math on that so it'd be a - number.. but doesn't seem to be supported in the code, and when I switch it to the off cart fixed mode, it still isn't working..
----------------------------------------------------------
screenshots
----------------------------------------------------------
rule 1
No conditions, Action shown below with item rule

rule 2
No conditions, Action shown below with item rule

results
Both discounts show but the total is not matching


texts: Magento2: How to get online customer collection list?

texts: I want to get online or logged In customer collection list.


texts:
My website has this cron job set to run every 30 mins and the cron.php/sh is set to run every 15 mins on the server. But I always get "missed" for this cron job. My cron configuration time setting is:

15
45
60
60
3000
3000

Also, I have noticed that every now and again we got the message (from aoe scheduler) saying "last heartbeat is older than *** (more than 15) mins" even more than an hour sometimes. Does this mean the cron.php/sh is not running properly? Hence the cron job is "missed"?

Please kindly advise!! Many Thanks!


texts: Magento2 how to show custom addresses in shipping address at checkout page with module

texts:
How can I override the shipping block and show my custom shipping addresses there with the module?
I have one custom table which has addresses with website id. I need to display that address in the shipping address section website-wise. It will show the address to the user which are related to that website on the checkout page.

i.e.  if i have 2 address in my custom table for website dev. then
when I come to the checkout page of the dev website. I need to show that 2
addresses there for the user to select anyone and do the checkout
process.

I have multiple addresses that need to be shown in front, so, user can select any one and go through.
I have one idea that I want to override the shipping address block and show there drop down of all addresses which are saved, then on the selection of address filled the shipping address form in hidden and fire save shipping address event. will it be useful?


texts: Magento 2 : change text "Refund Offline to Refund Store credit"

texts:
is their any way i can change this text of button ?
https://www.awesomescreenshot.com/image/7867140?key=86b39c1af672331d41d7d7da1ae189af
its credit memo button


texts: The page doesn't appear without the index.php in the link. Please tell me how to fix it. E.g. localhost/sitename/index.php/category/. I want to remove index.php from the URL.


texts: Magento 2 Add Custom Select to Customer : Source Model

texts:
I added an attribute to customer entity

My goal is to have this attribute as Select (with data from another db table), but i didn't find any tuto about the source/model that i should create !!

Here is the Files :

InstallData Vendor/Module/Setup/InstallData.php

<?php
    namespace Vendor\Module\Setup;

    use Magento\Customer\Setup\CustomerSetupFactory;
    use Magento\Customer\Model\Customer;
    use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
    use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
    use Magento\Framework\Setup\InstallDataInterface;
    use Magento\Framework\Setup\ModuleContextInterface;
    use Magento\Framework\Setup\ModuleDataSetupInterface;

    class InstallData implements InstallDataInterface
    {

    /**
     * @var CustomerSetupFactory
     */
    protected $customerSetupFactory;

    /**
     * @var AttributeSetFactory
     */
    private $attributeSetFactory;

    /**
     * @param CustomerSetupFactory $customerSetupFactory
     * @param AttributeSetFactory $attributeSetFactory
     */
    public function __construct(
        CustomerSetupFactory $customerSetupFactory,
        AttributeSetFactory $attributeSetFactory
    ) {
        $this->customerSetupFactory = $customerSetupFactory;
        $this->attributeSetFactory = $attributeSetFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

        /** @var $attributeSet AttributeSet */
        $attributeSet = $this->attributeSetFactory->create();
        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute(Customer::ENTITY, 'testfield', [
            'type' => 'varchar',
            'label' => 'Test Field',
            'input' => 'select',
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'visible_on_front' => true,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'source' => \Vendor\Module\Model\Customer\Attribute\Source\Test,
        ]);

        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'testfield')
        ->addData([
            'attribute_set_id' => $attributeSetId,
            'attribute_group_id' => $attributeGroupId,
            'used_in_forms' => ['adminhtml_customer','customer_account_create','customer_account_edit','checkout_register'],
        ]);

        $attribute->save();
    }
}

Source Model (Needed Code) : Vendor\Module\Model\Customer\Attribute\Source\Test

<?php
namespace Vendor\Module\Model\Customer\Attribute\Source;

class Test extends \Magento\Eav\Model\Entity\Attribute\Source\Table
{

    public function __construct(..........)
{
        ......................
    }

    /**
     * @return array
     */
    public function getAllOptions()
    {
        ...................

        return $this->_options;
    }

}

Could any one help me how to create this source model.


texts: How to make seo friendly form_key whishlist link

texts:
https://www.websitename.in/wishlist/index/addd/product/715/form_key/1LEJOC1edAL6N0Wi/

Seo person asked me to make these links seo friendly . Is there any way in which this can be achieved.


texts: Magento Cron Job is not working using module

texts:
I am new to Magento and trying to run Cron Job using module.

Here is my code
  app/etc/modules/FQLabs_Automail.xml

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

app/code/local/FQLabs_Automail/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
    <FQLabs_Automail>
        <version>0.1.0</version>    <!-- Version number of your module -->
    </FQLabs_Automail>
</modules>

<crontab>
    <jobs>
        <fqlabs_automail_send>
            <schedule>
                <cron_expr>*/5 * * * *</cron_expr>
            </schedule>
            <run>
                <model>automail/observer::doSomething</model>
            </run>
            </fqlabs_automail_send>
        </jobs>
    </crontab>

</config>

app/code/local/FQLabs_Automail/Models/observer.php

<?php
class FQLabs_Automail_Model_Observer
{

    public function doSomething()
    {
        Mage::log("This is a cron run test", null, 'mylog.log');
        return $this;
    }

}

?>

After clearing cache and re indexing indexes, I hit (www.yourstore.com/cron.php)
I have done everything right but still the log is not working.
Please suggest some help.
Module Link for Debug is here


texts: Add product to amazon using M2epro and Ignore custom option

texts:
I want to list simple products without custom options to Amazon using M2epro module.
I have all simple type products with custom options but I don't want to use custom options on Amazon. Can anyone have any idea that how we can ignore the custom options in m2epro and how we can customize the code?

Please help

Thanks


texts: Magento 2 in frontend can not able to get the customer custom attribute value

texts:
I have created a custom customer attribute, and while create and update customer from backend the value will be saved in Database.

But while do the same thing from front-end the value is not able to save in Database. Moreover, the backend saved value can not able to get using the customer load query.

In customer_form_attribute for that particular attribute have the following code
adminhtml_customer,customer_account_edit,customer_account_create

public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
         if (version_compare($context->getVersion(), '0.0.4', '<')) {
            $setup->startSetup();

            /** @var CustomerSetup $customerSetup */
            $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
            $customerSetup->addAttribute(
                \Magento\Customer\Model\Customer::ENTITY,
                'order_limit',
                [
                    'visible' => true
                ]
            );
            //$forms = ['adminhtml_customer', 'checkout_register', 'customer_account_create', 'customer_account_edit'];
            $forms = ['adminhtml_customer','customer_account_edit','customer_account_create','adminhtml_checkout','checkout_register'];

            $attribute = $customerSetup->getEavConfig()->getAttribute('customer', 'order_limit');
            $attribute->setData('used_in_forms', $forms);

            $attribute->save();
            $setup->endSetup();
        }
    }

Kindly share your thoughts and idea.

Thanks in advance for your support


texts: Are there any benefits of using Apache's mod_cache_disk with Magento 2?

texts:
I'm currently configuring a web hosting server (Ubuntu 16, Apache 2.4, 8GB RAM, 6 Core CPU) with about 20 Wordpress and Magento 1.9.X/2.2.X sites and would like to optimize it for speed with Apache's mod_cache_disk.

But I'm not sure if there are any benefits or possible side effects of using mod_cache_disk with Magento.

I noticed some side effects for the Wordpress sites, for example the browser shows a page which isn't requested, but for Magento I'm not seeing any issues at the moment.

The current Magento vhosts/htaccess file has this caching configuration:

CacheQuickHandler off
CacheLock on
CacheLockPath /tmp/mod_cache-lock
CacheLockMaxAge 5
CacheIgnoreHeaders Set-Cookie
<Location />
    CacheEnable disk
    CacheHeader on
    CacheDefaultExpire 600
    CacheMaxExpire 86400
    CacheLastModifiedFactor 0.5
</Location>

My questions are:

are there any benefits of using Apache's disk cache with Magento 1.9.X or 2.2.X or is this counterproductive because of Magento's native caching system?
are there any possible issues to watch out for if using this combination?

Also any general tips and experiences regarding this, would be appreciated.

Btw, I know that the recommended performance optimization for Magento is (in short) Nginx, Varnish, Redis, Memcached, but I currently don't have the knowledge nor the resources to configure this (although I am enthusiastic to do it one day).


texts: Execute Plugin Class from specific module in Magento2

texts:
I have created a custom reports using ui components.
For the export csv I have created a plugin class for this function.
Vendor/Report1//etc/di.xml
<type name="Magento\Ui\Model\Export\MetadataProvider">
        <plugin name="custom_export1" type="Vendor\Report1\Plugin\ModifyExportPlugin" sortOrder="1" disabled="false"/>
    </type>

I have used the same plugin in another 4 modules.
Vendor/Report2//etc/di.xml
<type name="Magento\Ui\Model\Export\MetadataProvider">
        <plugin name="custom_export2" type="Vendor\Report2\Plugin\ModifyExportPlugin" sortOrder="1" disabled="false"/>
    </type>

From the above code, if i export from any of the module, both the plugins are called, I need to avoid that,
When export is happened from Module Report1,the plugin from that module to be executed, if called from Report2, the plugin defined in that module need to call.
How this can be achieved? Can anyone help me to resolve this issue. Thanks in advance!!


texts: Error migrating data using Data migration tool 2.0.7

texts:
I am migrating from Magento 1.9.3 to 2.0.7 using the data migration tool and I get the following error:

  Syntax error or access violation: 1142 CREATE command denied to user
  sourceUser @'localhost' for table 'mg_m2_cl_ catalog_compare_item',

  query was: CREATE TABLE IF NOT EXISTS mg_m2_cl_catalog_compare_item
  ( catalog_compare_item_id int NOT NULL COMMENT
  'Catalog_compare_item_id' , operation text NULL COMMENT 'Operation'
  , processed bool NOT NULL default '0' COMMENT 'Processed' , PRIMARY
  KEY (catalog_compare_item_id) )
  COMMENT='mg_m2_cl_catalog_compare_item' ENGINE=INNODB charset=utf8
  COLLATE=utf8_general_ci

My database user configuration is as suggested in the config.xml

<!--
Set direct_document_copy = 1 for better performance.
NOTE: 'source' and 'destination' databases MUST be placed on the same MySQL instance
and 'destination' user MUST be granted with 'SELECT' permissions on 'source' database
-->

My source and database path are in the same instance, same user exists in both source and destination with select permission in the source database and full permissions on the destination database.

Tried using different users for source and database path and the Error is for the source database. It looks like the migration tool is creating tables in the source database which is not expected. Why is the tool creating tables in the source db? Do I have to grant permissions for CREATE in the source database. My biggest concern is would it create conflicts in the source db?


texts: Create public function for updating sales_order data Magento2.3

texts:
Help, please!

I'm using Magento 2.3 and I am trying to update sales_order table data programmatically.

What's the best way to implement it?


texts: Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory

texts:
I got an error after setting localhost , accessing localhost.

my virtual host configuration is below : ServerName local.defaultMagento.com

DocumentRoot "/Users/Androider/defaultMagento"

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding"
    Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, PUT"
    Header set Access-Control-Allow-Credentials true
</IfModule>

<Directory "/Users/Androider/defaultMagento">
    AllowOverride All
    Require all granted

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule ^api/rest api.php?type=rest [QSA,L]
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
        RewriteRule .* - [L,R=405]
        RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-l
        RewriteRule .* index.php [L]
    </IfModule>
</Directory>

I searched a lot and finally found that it may be caused by the permission in virtualHostConfiguration file.

But I think what I've done is nothing wrong...

Is there anyone helping me?


texts: Magento 1 : How to add custom filter in list page like price or name?

texts:
I'm building the frontend of the category page, among the filters that I have to create custom filter. I have no problem taking the data and having it available in the Mage_Catalog_Block_Product_List_Toolbar class, I can not change the query to apply the filter correctly.

I have full access to the collection, but I would like to know how to modify it in an "allowed" way


texts: How to use custom attribute for price instead of 'price' for specific site?

texts:
Our Magento platform is connected to our product database. We're first building a wholesale site and want to display the price as the attribute "list_price" instead of the standard "price" which is our MSRP.

It's not a flat rule like a % off so I can't use the catalog pricing rules. Also we will be building out retail sites using the same catalog so I need to retain the "price" value to be used on different websites.

We have Magento's attributes synced to custom values in our DB using a staging table, so it seems most logical to somehow substitute 'price' for 'list_price' with this website only. I just don't see how to do that.

We could connect our "list_price" to an existing attribute in Magento if that would be easiest. Special_Price comes to mind but I just want it to display as the normal price and not as a special price.

Any ideas on the best way to do this? Thanks so much.
Here's the site btw: http://wholesale.navajomfg.com


texts: Grid result not match the export result in magento 2

texts:
I created a module for some data logging with widget grid display and csv export function.

Inside the collection, I added a new columns with mysql function "IF(DATE_FORMAT(updated_at,'%H:%i') = '16:30',DATE_FORMAT(updated_at,'%Y-%m-%d'),'')"

The result is correct in the exported csv but not for grid.


texts: Owebia grand total showing wrong after placed order

texts:
I use bellow code for shipping price will add 50% extra of grand total which is tax, subtotal, and discount, but It not working on Magento 2.3. It showing invalid grand total and shipping after place order but before that, it showing right on the frontend.
addMethod('test', [
   'title'      => "3 Days",
'enabled'    =>  $request->dest_region_id!= '52',
   'price'      => ($quote->grand_total)*.50,
]);

On magento 1x I have faced same issue but it fixed by using:
cart.price+tax+discount

But on Magento 2.3 I can't find the tax and discount.


texts: Add default value in billing address checkout page Magento 2

texts:
I want to login customer address show in checkout page billing address.
See screen-short,

For Ex :- City is input-box and i want to show city name value.
If the customer is registered, then I want to get the of the customer added city.
THANKS.


texts: How can I assign the images of configurable product to it's simple products (configurations)?

texts: I need to assign the images of the configurable product to its configurations (the simple products assigned to it). Can anyone help me with this?


texts: Stalling on Card Validation -- "Please Wait" for over 30 seconds

texts: This has turned into a frequent and reproducible occurrence. During checkout from the back-end, after entering all the customer information.. you select any of the payment type boxes (Check, PO or CC) and you get more than 30 seconds of "Please Waiting". Any ideas of what this might be or how I might trouble shoot it?


texts: How to Uninstall Magento Community Edition

texts:
I have Magento Community Edition installed on a shared hosting account.  Is there a built-in uninstaller for Magento?
There's dozens of files / directories scattered throughout the root directory and I'd like to only get rid of the ones that are associated with Magento.


texts: Trying to rewrite url in .htaccess resulting in all css/js & admin blocked

texts:
After playing with the .htaccess i've hit a brick wall. My site will load from just the domain name but won't load any css or js.

here's my .htaccess:

Options +FollowSymLinks

RewriteEngine On

RewriteBase /magento/

RewriteRule . index.php [L]

Magento is located in Httpdocs/magento/

This is my first time editing a .htaccess file

I have base URLS set to http://mystore.com/magento/

I have seo rewrites enabled


texts: Magento Change Currency Separator Punctuation

texts:
Current Price Display in Indonesian Currency: RP3.075.167,50
How do I change to display in RP3,075,167.50

<symbols>
        <decimal>,</decimal>
        <group>.</group>
    </symbols>
    <currencyFormats>
        <currencyFormatLength>
            <currencyFormat>
                <pattern>¤#,##0.00</pattern>
            </currencyFormat>
        </currencyFormatLength>
    </currencyFormats>

Chris


texts: How arrange payment methods order in magento 2 checkout payment section?

texts:
I have found the answer and put it in the comment, for quick reference I'll keep this question

I want to change magento 2 checkout section payments methods sort order,

originally its come as

1 - paypal
2 - sagepay

So I want to arrange it as

1 - sagepay
2 - paypal.

Need help.
Thanks


texts: No such entity issue while placing order in front end?

texts:
How to fix the  no such entity issue error in front end while placing the order. I have tried to setup update queries for store table but it is not worked. Please help me to fix this

This is the function showing error

public function getActive($cartId, array $sharedStoreIds = [])
    {
        $quote = $this->get($cartId, $sharedStoreIds);
        if (!$quote->getIsActive()) {
            throw NoSuchEntityException::singleField('cartId', $cartId);

        }
        return $quote;
    }


texts: Magento 2 - Import product quantity is empty after product csv import

texts:
In Magento 2.3.1, When I Go to admin panel

System -> Import -> Products and Upload product CSV.

Product imported with all information but miss qty, it shows empty.

Any help, experience and knowledge sharing would be appreciated


texts:
I have a module in app/code/local/Smartwave/Ajaxcatalog/Block/Layer/Filter/Price.php. In this file, theres a function, called getSliderJs.

Now I do want to override this method. I've created my own module and created a new file in app/code/local/Vendor/Module/Block/Layer/Price.php.

I extend it with class Vendor_Module_Block_Layer_Price extends  Smartwave_Ajaxcatalog_Block_Catalog_Layer_Filter_Price.

However, I've activated the module by creating the corresponding XML files, however, it does not extend the desired method.

Do I need to put something else in config.xml, or get such blocks autoloaded? Afaik module files get autoloaded by ZF enginge but it seems that I'm completely wrong here.


texts: I have installed PWA venia in frontend magento 2.3 but images are not loading.


texts: I want to know the name of the theme in the below site

texts:
I want to know the name of the theme of this website https://www.nappadori.com/ .

I have seen this question How to check which theme is being used in a magento based website. to detect the theme but the theme folder is named as the name of the website.


texts: jQuery conflict in the product view page

texts:
I implement jquery lazyloads to load product images on scrolling..

I added the following codes to view.phtml

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.lazyload.js?v=1.9.7'); ?>"></script>
<script type="text/javascript" charset="utf-8">

$(function() {
 $("img.lazy").lazyload({
     effect : "fadeIn"
 });
});

</script>

<?php foreach ($galleryCollection as $_image): ?>
        <img class="lazy products" data-original="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())->keepFrame(false)->resize(426,700); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'image'), null, true);?>" />
<?php endforeach; ?>

The out put is fine as i expected.Images are loading on scroll.
BUT
Unable to click the magento view option button.
Code for view option button click is below.

<script type="text/javascript">

    Event.observe($('show_bundle_options'),"click",function(){
    $('bundle_options').show();
    $('bundle_options_background').show();
    });
</script>

I can understand that this is jQuery conflict.I tried several ways to add jQuery.noConflict(); its not working.
If the options works fine images are not loading if the images load Options are not working.

Is there any other ways to load the image on scrolling the page?

I am using magento 1.7 version.

Please help me to sort it out.


texts:
I need to create default billing address for new user.
To create billing/shipping address I'm using the next code:

protected function createAddress($isDefaultBilling = false, $isDefaultShipping = false) {

        $address = $this->addressFactory->create()
            ->setCustomerId($this->customerObject->getId())
            ->setIsDefaultBilling($isDefaultBilling)
            ->setIsDefaultShipping($isDefaultShipping)
            ->setCity('n/a')
            ->setCountryId('UA')
            ->setCompany('n/a')
            ->setFax('n/a')
            ->setFirstname($this->customerObject->getFirstname())
            ->setLastname($this->customerObject->getLastname())
            ->setPostcode('n/a')
            ->setStreet(['n/a'])
            ->setTelephone('n/a');

            return $this->addressRepository->save($address);
            // die('testing'); // wut???
            // return $address;

    }

$this->addressFactory is an instance of \Magento\Customer\Api\Data\AddressInterfaceFactory

and $this->addressRepository is \Magento\Customer\Api\CustomerRepositoryInterface

The code looks properly, and in var/debug/db.log I see the query:

## 2016-10-14 10:52:27
## 2909 ## QUERY
SQL: INSERT INTO `mg_customer_address_entity` (`parent_id`, `created_at`, `updated_at`, `city`, `company`, `country_id`, `fax`, `firstname`, `lastname`, `postcode`, `street`, `telephone`) VALUES (?, '2016-10-14 10:52:27', '2016-10-14 10:52:27', ?, ?, ?, ?, ?, ?, ?, ?, ?)
BIND: array (
  0 => 12,
  1 => 'n/a',
  2 => 'n/a',
  3 => 'UA',
  4 => 'n/a',
  5 => 'fname',
  6 => 'lname',
  7 => 'n/a',
  8 => 'n/a',
  9 => 'n/a',
)
AFF: 1
TIME: 0.0015

BUT there is NO data in database!

For debug, I saw in /home/serf/www/magento/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php, and in function save the call $this->isModified($object) returns false.

I tried to use \Magento\Customer\Model\AddressFactory:

$model = $this->addressModelFactory->create();
$model->setDataChanges(true);
$address = $model->getDataModel()
    ->.....

But the result was not changed.
And, finally, I tried $model->getResource()->save($model). And got an error like "City is required field".

I tried more ways, but each time the behaviour is different: it may assign new ID to billing/shipping (but the data was not saved in database!), or die with message like "No such entity with addressId = 122", when I try to edit the new billing.

In the last I've uncommented the string die('testing');, and the address was created. Even if I don't change the billing after creating, it appears in database only if die(..) is uncommented.
So, what am I doing wrong?

UPD. How am I using the code:

$this->defaultBilling = $this->createAddress(true, false);
$this->customerObject->setDefaultBilling($this->defaultBilling->getId());
$this->customerRepository->save($this->customerObject);

where $this->customerObject is instance of Magento\Customer\Api\Data\CustomerInterface, and $this->customerRepository -- Magento\Customer\Api\CustomerRepositoryInterface


texts: Magento 1.9 CSS file isn't loading home page

texts:
Using Premium aspire theme. I want customize stylefrom my own css code.

Added css file location: skin/frontend/rwd/aspire/css/customstyle.css
Added page.xml and local.xml(I know any one add but just try add both file) app/design/frontend/base/default/layout/page.xml
and
app/design/frontend/rwd/aspire/layout/local.xml

 <action method="addItem">
    <type>skin_css</type>
    <name>css/customstyle.css</name>
 </action>

Cache updated It's not view. I also get url through access customstyle.css unfortunately I can't view source of home page.

Please help me any other solution


texts: In Magento 2.3, Is possible to cancel the Holded order?

texts: In magento 2.3, Is possible to cancel the holded status order?


texts: Adding Custom Currency in Magento 2.1.13 Store?

texts:
I want to add Custom currency option as (points) in my store like  Rupees,dollars and euros etc. Is there any module for this ??.  Can any one help to write the code for this ?
ThankYou.


texts: Magento 2 - How to format cart item price?

texts:
In magento 2, I don't know how to format cart item price.

I have a price format like this : £1,522.58 and I want this format £1522,58

I succeed to change the format of the total cart price by overriding

 getPriceFormat() method in Magento\Framework\Locale\Format.php file.

But it doesn't work for cart item total.

Do you know how to make this change ?

Thanks


texts: Prevent Magento from rolling back custom table entries

texts:
I am using third-party integration for on-site credit/debit card payment functionality.

With a purpose to audit transactions and as well as for order status flow customization, I need to save customer and payment related details in custom table.

But whenever, any error is detected from third-party gateway(i.e. Insufficient balance) while placing an order and thus invoking authorize/capture request to third party gateway, Magento rollbacks transaction including my custom table audit entries.
I know, reverting transaction to its begin stage is a perfect thing for data integrity and according to standard Magento architecture, but I just do not want to get my custom entries in my custom table to get rolled back.

How do I prevent Magento from doing this?

Can observer(dispatchEvent) be used to audit data as I am not sure if observer actually bypasses the standard transaction rollback call?

UPDATE

dispatching custom using Mage::dispatchEvent, is of no help
direct query(core/resource) to insert records will also get rolled
back in case of any error/exception before order successfully gets placed.


texts:
Can we add group of customer attribute for max quantity at time of product insertion.

i have explain in image please follow the image.


texts: Frontend is Broken When Uploading Destino Theme

texts: I am new to magento. I installed magento and checked everything was working fine with default Luma theme. When I uploaded the Destino theme as per the documentation given, the frontend is not loading properly. PFB the screenshot. My Website URL: http://switchoriginals.brandfabricator.com/


texts:
I have searched all over internet but found nothing... What file inserts data into core_email_queue table in magento while successfully saving the cart data...

Can anybody help me because I wanted to send email instantly when the user checkouts successfully


texts: Magento 2 - Show custom Block on Cart Page

texts:
Namespacee/Modulename/Block/Productpoint.php

<?php

namespace Namespace\Modulename\Block;

class Productpoint extends \Magento\Framework\View\Element\Template
{

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

}

Namespace/Modulename/view/frontend/layout/checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <referenceContainer name="content">
            <block template="checkout/cart/productpoint.phtml" class="Namespace\Modulename\Block\Productpoint" name="productpoints.cart.block" as="productpointblock" before="-"/>
        </referenceContainer>

</page>

Namespace/Modulename/view/frontend/templates/checkout/cart/productpoint.phtml

<?php echo 'Eureka'; ?>

The block is not loading on cart page. How do I call my custom block on cart page ?


texts: ACL Resources Access Customization and Admin form customization

texts:
I am new to magento so can somebody please help me out?

I have created a new user (belonging to custom role group = vendor) who can login to admin panel and add their own products, for that i have used the new product form specified in catalog module (url : ...admin/catalog/product/new/set...). Now there are 2 things that I want to do:

1.) On that form their are some fields (like Attribute Set) that should be visible only if user role belongs to group Administrators and not the custom role group (vendor) that I created. How can I modify those form fields to be hidden and have a default value on vendor login?

2.) The custom role users should only be able to access the product add/edit form and not the product listing page (I have created custom listing that shows products added by that user which needs to be displayed instead of the entire catalog product listing). How can I achieve this? If I give access to Magento_Catalog::products resource, they can access the product listing page also which I need to deny access to.


texts: In Magento 2 use the after plugin in place order function, in the plugin i can't get the order id?

texts:
in Magento 2 i extend the magento place order function \Magento\Sales\Model\Order but i did give the order id

public function afterPlace(\Magento\Sales\Model\Order $subject, $result){
    $this->logger->info($subject->getId());
    $this->logger->info($subject->getIncrementId());
    return $result;
}


texts:
I'm sure there is a solution but I just can't find it in because I'm not sure what to ask in google.

Is there a a way to have tiered pricing based on the total units sold in the deal?

For example I have a machine that anyone can buy. But the more people that buy the lower the price gets for everybody. It doesn't have to be a friend just as long as 10 other people buy the new price will kick in.

Thoughts?


texts: Last Logged In, in Customers always shows 'Never (Offline)'

texts: The Last Logged In status, in Customers  always shows 'Never (Offline)' Does anyone know how to fix. It says the date an account was created but always shows 'Never (Offline)' as last logged in.


texts: Can not create an instance of magentoframeworkappdeploymentconfig

texts:
I get this error when i try bin/magento comand from CLI

An abstract factory could not create an instance of magentoframeworkappdeploymentconfig(alias: Magento\Framework\App\DeploymentConfig)

how can i fix or debug?

just try :

change php7.3 to php7.2 version
composer install
composer update
rm -rf pub/static/frontend/ && rm -rf pub/static/_cache && rm -rf var/view_preprocessed/ && rm -rf var/cache && rm -rf generated/code
    && rm -rf pub/static/adminhtml/ &&  rm -rf generated/metadata


texts: How can I check if all extension are working properly?

texts: To install a special extension I had to lower my PHP version. I don't know if this can cause trouble for my other extensions, is there a fast way to check all extensions?


texts: how to add category products (only 4 products) in homepage rwd theme?

texts:
I want to display each category (only 4 products) on the homepage. I m new in Magento.

Biscuits/Cookies

View all products

{{block type=”catalog/product_list” name=”home.catalog.product.list” alias=”products_homepage” category_id=”4″ template=”catalog/product/custom_list.phtml”}}


texts: URL rewrite and 404 error pages [SOLVED]

texts:
After installing Magento 1.8 CE and importing categories I realized that all category pages gives me an error. I have tried:

Truncate the core_rewrite_url table and regenerate
Re-index category url rewrite
Disable url rewrite in system-config-web

But nothing solves this issue. I don't know what I have to do, any idea welcome.


texts: Trying to Load Previous Quote to Cart Session

texts:
I'm trying to load a quote from a previous order into the cart in magento, though stuck here:

This code works the first time around, it adds the product to the cart.
However, if I refresh the page, the cart gets emptied out.

Can someone please advice what I'm doing wrong here?

Magento 1.9

$torder = Mage::getModel('sales/order')->loadByIncrementId($url_params['order_id']);
$tquoteId = $torder->getQuoteId();
$tquote = Mage::getModel('sales/quote')->load($tquoteId);

if ($tquote->getId()) {
   $tquote->setIsActive(1);
   Mage::getSingleton('checkout/session')->replaceQuote($tquote);
   Mage::getSingleton('customer/session')->setCartWasUpdated(true);
}