texts:
I want to redirect customer to last visiting page after loggedin.
My code as far looks like:
Config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Virtua_Vcategory>
        <version>1.0.0</version>
    </Virtua_Vcategory>
</modules>
<global>
    <models>
        <virtua_vcategory>
            <class>Virtua_Vcategory_Model</class>
        </virtua_vcategory>
    </models>
    <helpers>
        <virtua_vcategory>
            <class>Virtua_Vcategory_Helper</class>
        </virtua_vcategory>
    </helpers>

    <blocks>
        <virtua_vcategory>
            <class>Virtua_Vcategory_Block</class>
        </virtua_vcategory>
    </blocks>

</global>
<frontend>
    <events>

        <catalog_controller_category_init_after>
            <observers>
                <virtua_vcategory>
                    <type>singleton</type>
                    <class>virtua_vcategory/observer</class>
                    <method>catalogControllerLoadAfter</method>
                </virtua_vcategory>
            </observers>
        </catalog_controller_category_init_after>

        <customer_login>
            <observers>
                <virtua_vcategory>
                    <class>virtua_vcategory/observer</class>
                    <method>customerLogin</method>
                </virtua_vcategory>
            </observers>
        </customer_login>
  </events>
</frontend>
</config>

Observer:

 <?php

 class Virtua_Vcategory_Model_Observer extends Mage_Core_Model_Abstract
 {
   public function catalogControllerLoadAfter(Varien_Event_Observer $observer)
{
    ...

    if (Mage::getSingleton('customer/session')->isLoggedIn()) {

        ...
    }
    else
    {
        $beforeurl = Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::helper('core/url')->getCurrentUrl());

        MAGE::log($beforeurl );     /****first log*****/

        $route = 'customer/account/login';
        $url = Mage::getUrl($route);
        Mage::app()->getResponse()->setRedirect($url);
    }
}
     public function customerLogin(Varien_Event_Observer $observer)
    {

    $url = Mage::getSingleton('customer/session')->getBeforeAuthUrl();

    MAGE::log($url." after log in");     /*****second log*****/

    Mage::app()->getResponse()->setRedirect($url);
    }
}

And my first log (in catalogControllerLoadAfter() ) showing properly urlin object, but in second log url is overwritting. How can i fix it?


texts: Fishpig WordPress Integration Homepage Not Working

texts:
I can't get the Fishpig WordPress extension to work no matter what I do. The link to the extension is here:

http://fishpig.co.uk/magento/wordpress-integration/

I've installed it and configured it all correctly. The weird thing is that I can go to the post pages fine at the correct url:

http://www.example.com/blog/post-name/

I'm trying to put the whole blog at the 'blog' subdirectory. The issue is that all pages work except for the main page:

http://www.example.com/blog/

Every time I try to visit it, I get redirected to the homepage. I think it's conflicting with the core Magento blog (which I've disabled) because when I enable it, the link http://www.example.com/blog/ opens but it opens to the blank Lorem Ipsum blog through Magento. I've changed the main URL for this blog to 'http://www.example.com/news/' which also works (both the /news/ and /blog/ work). I was thinking the name 'blog' was conflicting or something along those lines.

So then I tried to change the path to the blog to:

http://www.example.com/site-blog/

But when I had that all set up, the posts worked with this structure:

http://www.example.com/site-blog/post-name/

But when I tried to go to the main homepage, it gave me a 404 error.

I'm out of ideas as to what's going on. Any ideas on what I can do to just get something up and running? Thanks for your help.


texts:
I am very much a novice when it comes to magento. I've self taught myself in areas i can. Long story short a web designer who was all the talk and not much of the walk designed a website for our store then left it all to us. I don't know code, but i was fiddling with some things and must of made an error with one of the static blocks and now our web pages is like this in the footer (see picture)

How can i change it to evenly spread across the page?

Here is info of the static block. Any help is appreciated,

THANKS!


texts: How can I know when an element is shown or hidden in a checkout step?

texts:
I try to create custom functions when a element is shown in checkout step.
For example, when I go to the next step, i would like to get an event "onload" of the all elements in this new step


texts:
I have a problem with coupon codes in magento.

I created a lot of coupons for testing in all possible ways and nothing is working.

None of them work, and the same error (when the customer enters the coupon code) is displayed every time... The coupon "coupon_name" is not valid.

EDIT:

Below some pics with the coupon rule:


texts: Magento 2: How to override lib/web/tiny_mce/tiny_mce_src.js?

texts:
I made some changes in tiny_mce_src.js to avoid wrapping elements in <p> tag in wysiwyg editor (I set forced_root_block : '' in 11277 line).

Is it possible to override ./lib/web/tiny_mce/tiny_mce_src.js in Magento 2?


texts: How to use a backend_model for my field in system.xml in Magento 2?

texts:
I had setup this system.xml file

...

                Account configuration
                <tab>account_info_tab</tab>
                <resource>myvendor_mymodule::config</resource>
                <group id="account_configuration" showInDefault="1" showInWebsite="1" showInStore="1">
                    Account login
                    <field id="title" translate="label comment" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                        Token API
                        <backend_model>Myvendor\Mymodule\Model\Config\TokenAPI</backend_model>
                        <validate>required-entry</validate>
                    </field>
                </group>

...

I want to use a custom backend_model because i want to verify the data before saving it (have to use web services).

Then i have my TokenAPI backend_model

class TokenAPI extends \Magento\Framework\App\Config\Value{
    function __construct(\Magento\Framework\Exception\LocalizedException $e){
        $this->localizedException = $e;
    }

    public function beforeSave(){
        echo '
';
            print_r($this->getValue());
        echo '
';

        exit;
    }
}

The problem that im having is that as soon i uncomment the backend_model in system.xml the field stops working throwing this error

  [2016-05-03 13:28:23] main.CRITICAL: Missing required argument $text of Magento\Framework\Phrase. [] []


texts: A fresh install magento2.1, error 404 not found

texts:
A fresh install Magento2.1, but there is "404 not found" error on every page except index.php and in backend.

Beside index.php page's layout is a mess.

Any advice would be appreciated.


texts: Can I have a router frontname with a wild card

texts:
I have built a custom extension for a client for a landing page.  This extension works perfectly with everything is does but I would like to support multiple frontnames in the router so that this one extension could handle multiple landing pages.  Right have I have this in the etc/config.xml

<frontend>
    <routers>
        <landingpage>
            <use>standard</use>
            <args>
                <module>Client_LandingPage</module>
                <frontName>landing-page</frontName>
            </args>
        </landingpage>
    </routers>
</frontend>

I would like to be able to something like this: landing-page/* so that it would handle any page like /landing-page/some-page or /landing-page/another-page, is there anyway to do this?

<frontend>
    <routers>
        <landingpage>
            <use>standard</use>
            <args>
                <module>Client_LandingPage</module>
                <frontName>landing-page/*</frontName>
            </args>
        </landingpage>
    </routers>
</frontend>


texts: Error 500 on product detail page in Magento2

texts:
When I am trying to open product detail page I am getting error Http Error 500.
Also, no log is generated to fetch any error. Everything else works fine except the product detail page.

I did

cache:clean,
cache:flush,
indexer:reindex.

Then Deleted Browser Cache.


texts: Currency switch rewrite does not preserve querystring

texts:
Magento version 1.9.4

We are using Magento currency switcher URLs, and we need to add some query string at end, but when it resolves the rewrite, the querystring is gone.

Ex:

https://www.website.com/directory/currency/switch/currency/DKK/uenc/aHR0cHM6Ly93d3cucGVyZnVtZXNwcmVtaXVtLmNvbS9pbmRleC5waHAvc2hpbW1lcmluZy1jcmVhbS1leWUtY29sb3ItZ3IxMjUtbmFpYWQtNi1ncg?key=value

Resolves to:

https://www.website.com/index.php/some-product-page

While we would like to have:

https://www.website.com/index.php/some-product-page?key=value

We've been looking around and found this:

https://community.magento.com/t5/Programming-Questions/Magento-Redirect-Loses-URL-Querystring/m-p/4773#M1163

But it does not seem to apply, since the URL there seems to have already been rewritten, and querystring is nowhere to be found.

Is there a way to modify currency url rewrite so that it preserves querystring?

Thanks!


texts:
I want to make changes(PHP code) to the method processPaymentConfiguration, but I don't know how I can override the method so my changes have a higher priority. I can alter the LayoutProcessor file but it's never good to apply changes to a core file.

So my question; is this possible and what do I need to do to achieve this?

Vendor/Module/Block/Checkout/LayoutProcessor.php

<?php
namespace Vendor\Module\Block\Checkout;

use Magento\Framework\App\ObjectManager;
use Magento\Checkout\Block\Checkout\LayoutProcessorInterface;
use Magento\Customer\Model\AttributeMetadataDataProvider;
use Magento\Ui\Component\Form\AttributeMapper;
use Magento\Checkout\Block\Checkout\AttributeMerger;
use Magento\Customer\Model\Options;

class LayoutProcessor implements LayoutProcessorInterface
{
    private $attributeMetadataDataProvider;
    protected $attributeMapper;
    protected $merger;
    private $options;

    public function __construct(
        AttributeMetadataDataProvider $attributeMetadataDataProvider,
        AttributeMapper $attributeMapper,
        AttributeMerger $merger
    ) {
        $this->attributeMetadataDataProvider = $attributeMetadataDataProvider;
        $this->attributeMapper               = $attributeMapper;
        $this->merger                        = $merger;
    }

    private function getOptions()
    {
        //same code as Magento/Checkout/Block/LayoutProcessor::getOptions()
    }

    private function getAddressAttributes()
    {
        //same code as Magento/Checkout/Block/LayoutProcessor::getAddressAttributes()
    }

    private function convertElementsToSelect($elements, $attributesToConvert)
    {
        //same code as Magento/Checkout/Block/LayoutProcessor::convertElementsToSelect()
    }

    public function process($jsLayout)
    {
        //same code as Magento/Checkout/Block/LayoutProcessor::process()
    }

    private function processPaymentConfiguration(array &$configuration, array $elements)
    {
        /*
        code from Magento/Checkout/Block/LayoutProcessor::processPaymentConfiguration()
        with a couple changes.
        It works when I apply the changes in code file (vendor/magento/magento-checkout/...)
        */
    }
}

When I var_dump processPaymentConfigurationfrom the core and my custom code, I get the same results. So it looks like the code executes and returns the right thing but nothing is happening.

Vendor/Module/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Block\Checkout\LayoutProcessor" type="Vendor\Module\Block\Checkout\LayoutProcessor" />
</config>


texts: M1.9 Translation string with link in csv

texts:
In my login.phtml I have a custom string containing a link and I do not succeed to translate it with the translate.csv of my custom theme.

'If you are private customer please visit our Shop for home-users.'

Can anyone help?


texts:
I want a fixed price in my bundle product. According to the Magento official documentation I have to set "Dynamic Price" to yes and then change the Price input. The problem is that the Dynamic Price input is disabled and I don´t know the proper way to change it.

What I try is update the value in the table "catalog_product_entity_int" where the attribute_id was equal to "130 (dynamic price id)" and the entity_id equal to my product id. With this update I could add a fixed price but I know there should be a better way.
All of this is in a new magento 2.4.0 installation


texts: Magento 2 : Cannot disable page cache of Product Detail Page

texts:
Tried to set cacheable="false" in a block in catalog_product_view.xml. But the product detail page is still being cached.
I just want to disable the cache of the Product Detail Page. How can I do this?
Thanks in advance.


texts:
What is the magento 2 equivalent of $_SERVER['QUERY_STRING']

I want to retrieve the full query string from the url and would like to do this using the framework's built in functions.


texts:
After daily debugging I'm a little bit confused about some core functionalities in Magento.

In Item.php file in app/code/core/Mage/CatalogInventory/Model/Stock/ there is the function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) ... Right above there are some explanations like:

/**
 * Checking quote item quantity
 *
 * Second parameter of this method specifies quantity of this product in whole shopping cart
 * which should be checked for stock availability
 *
 * @param mixed $qty quantity of this item (item qty x parent item qty)
 * @param mixed $summaryQty quantity of this product
 * @param mixed $origQty original qty of item (not multiplied on parent item qty)
 * @return Varien_Object
 */

Despite reading I am still confused about the summeryQty parameter. What exactly does this one? What's the difference between an item and a product in Magento??

If I output this parameter I'll get the value 2. But where does this 2 come from?
This questions belong to an other problem but first I like to understand what this summaryQty parameter is about.

I know, its really theoretically but maybe anyone has a clue whats going on here.


texts: Set "minimum order amount" per store view

texts:
I'm looking for a way/extension to set the minimum order amount per store view.

It is an existing webshop, which already has a big customer file. This makes it a problem to implement an extension that allows different minimum order amounts per customer group.

At this moment it is only possible to set the minimum order amount per store, but not per store view. However, the shop I'm working on has two languages set within the same shop. For the language for people living outside of the native country, I would like to set a (different) minimum order amount, since that needs to be sent abroad most of the time.

Is this possible, and if so, how?


texts: checkout_controller_onepage_save_shipping_method events not wroking

texts:
<events>
    <checkout_controller_onepage_save_shipping_method>
        <observers>
            <Training_Customcheckout_sales_order_shipment_save_before>
                <type>singleton</type>
                <class>Training_Customcheckout_Model_Observer</class>
                <method>setShippingCommentToQuote</method>
            </Training_Customcheckout_sales_order_shipment_save_before>
        </observers>
    </checkout_controller_onepage_save_shipping_method>
    <checkout_type_onepage_save_order>
        <observers>
            <Training_Customcheckout_sales_order_shipment_save_after1>
                <type>singleton</type>
                <class>Training_Customcheckout_Model_Observer</class>
                <method>setShippingCommentToOrder</method>
            </Training_Customcheckout_sales_order_shipment_save_after1>
        </observers>
    </checkout_type_onepage_save_order>
</events>

I have call this events and in observer:

class Projectwork_Deliverydate_Model_Observer extends Varien_Object{
    public function setShippingCommentToQuote($observer)
    {
        $event = $observer->getEvent();
        $quote = $event->getQuote();
        $request = $event->getRequest();

        $orderComment = $request->getPost('shippingComment', false);
        $session = Mage::getSingleton('checkout/session');
        $session->setData('shipping_comment', $orderComment);
    }

    public function setShippingCommentToOrder($observer)
    {
        $session = Mage::getSingleton('checkout/session');
        $shippingComment = $session->getData('shipping_comment');

        if($shippingComment){
            $observer->getEvent()->getOrder()->setShippingComment($shippingComment);
        }
    }

}

But its not working when I click continue to payment method from front end.


texts: Fatal Error Unsupported operand types in Gtm.php

texts:
I am getting White screen to access new category and the follow error in nginx/log/error.log:

[error] 1691#0: *80122 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Unsupported operand types in /usr/share/nginx/sites/exanple/app/code/local/MyVersion/GoogleTagManager/Block/Gtm.php on line 43" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: example.com, request: "GET /utensilios-cozinha/categoria-teste HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "example.com"

The line 43 have:

$data = $data + $this->_getTransactionData();

Check my code Pastebin: http://pastebin.com/EeCT9gh5


texts: Get data from database using Magento Models

texts:
I have some sql queries and I need to get the same data returned by those queries, using Magento models. Since I'm very new to Magento, I don't know how to do this. Following are the sql queries.

SELECT * FROM widget_instance wi, widget_instance_page wip WHERE wi.instance_id = wip.instance_id";

SELECT identifier FROM cms_block WHERE block_id = '2';


texts: Multi-Website, Multi-Prices - A common scenario made complicated

texts:
My first question here. I am developing a Magento 2 Website under 1 Domain. We have 7 areas in the world where we have 7 different prices.

Now I learned, Magento 2 (and even 1) is not switching prices on Store Scope but on Website Scope. How can I add a Switcher? Users should be able to switch to different shops.

It is a basic Shop by Country scenario but I am totally lost right now.
Please...please help.


texts: How to add more pincodes in Cash on Delivery restriction module?

texts:
I am using custom module Cash on delivery restriction by zipcodes for Magento 1.9.3.7

I am having an issue to add pincodes more than 10 thousand. This module only accepts 8 thousand pincodes.

here is Observer class

class Mfp_Cod_Model_Observer
{
    public function getCashOnDelvery(Varien_Event_Observer $observer)
    {
        $event           = $observer->getEvent();
        $method          = $event->getMethodInstance();
        $result          = $event->getResult();
        $isModuleEnable  = Mage::getStoreConfig('cod/cod/enable');

        if ($isModuleEnable) {
            if ($method->getCode() == 'phoenix_cashondelivery' ) {
                $quote          = Mage::getSingleton('checkout/cart')->getQuote();
                $add            = $quote->getShippingAddress();
                $postcode       = $add->getData('postcode');
                $comparisonMode = Mage::getStoreConfig('cod/cod/mode');
                $zipCodes       = Mage::getStoreConfig('cod/cod/zipcode');
                $isExist        = false;

                if (trim($zipCodes) == '') {
                    $result->isAvailable = true;
                } else {
                    if (strpos($zipCodes, $postcode) !==  false) {
                        $isExist = true;
                    }

                    if ($isExist != true) {
                        $zipCodesArray = explode(',', nl2br($zipCodes));
                        if (count($elementLineArray) > 1) {
                            foreach ($zipCodesArray as $codzipLine) {
                                $elementLineArray = explode('-', $codzipLine);
                                if (count($elementLineArray) == 2 && ( $postcode >= $elementLineArray[0] && $postcode <= $elementLineArray[1] )) {
                                    $isExist = true;
                                    break;
                                } else if ($postcode == $codzipLine) {
                                    $isExist = true;
                                    break;
                                }
                            }
                        }
                    }

                    $returnValue = '';
                    $returnValue = ($isExist)?true:false;

                    $result->isAvailable = $returnValue;
                }
            }
        }
    }
}

can anyone help me to resolve this issue. is there any limitation for data saving. How can I add more than 10 thousand zipcodes?


texts: Shipping rates not working after installing OneStep CheckOut extension

texts:
I have WebShop Matrix Rates extension in my store through which I have defined city-to-city and weight wise rates.They work perfectly fine without this new OneStep Checkout extension however when I enable this extension the rates do not get displayed in one step checkout page and the product is billed without shipping rate. Any help?
The one step checkout extension is Lotus Breath-One Step Checkout


texts: Huge amount of session data in /var/sessions

texts:
The website just went down, restarted the server and within a minute it went down again.

I quickly found out the problem was that the disk quota had been exceeded and allowed memory exhausted.

This was due to hundreds of thousands if not millions of sess_* files in var/session folder.

I tried lots of ways to remove them and this is what worked:

find . -name 'sess_*' | xargs rm

My Website is now back in good condition and no errors for now but within minutes I can see there are over 500 new session files.

Is this normal?

What should I do to prevent the server going down?


texts: Magento Product Sorting for Ink Cartridges

texts:
Hopefully somebody may be able to help me with this?

I am trying to change the sort order of products on Magento, it is a website that sells ink cartridges.

The order I want to always displays products is as follows:

MultiPack
Black
Cyan
Magenta (actually wrote magento here initially, going mad!)
Yellow

It is setup as a simple product with an additonal attribute of cartridge colour, I have set default sort order in magento config to cartridge colour but it still displays in order

Black
Cyan
Magenta
Multipack
Yellow

Any help would be greatly received.


texts: Difference in performance between load and using collections

texts:
Is there any difference in performance between load and the use of collections?

I was told that it is better to use this:

$product = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('*')
            ->addAttributeToFilter('entity_id', $productId)
            ->getFirstItem();

instead of this:

$product = Mage::getModel('catalog/product')->load($item->getId());


texts: Custom Admin controller not displaying in magento

texts:
I have created easylife admincontroller and it configure the config.xml, and I give the Url-> protocal://Ipaddress/ics/admin/admintest but it's not displaying.

can any one tell me where I went wrong?

my code is:

Ics->EasyLife->controllers->Adminhtml->IndexController.php

<?php

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

Ics->EasyLife->Block->Adminhtml->Template.php

<?php
class Ics_EasyLife_Block_Adminhtml_Template extends Mage_Adminhtml_Block_Widget_Form
{
    public function MyMethod()
    {
        echo "Admin Html Page Method";
    }
}

Ics->EasyLife->etc->config.xml

<admin>
        <routers>
            <icscontroller>
                <use>admin</use>
                <args>
                    <module>Ics_EasyLife</module>
                    <frontName>admintest</frontName>
                </args>
            </icscontroller>
        </routers>
    </admin>

thanks in advance.


texts: Terms and Conditions on checkout via block

texts:
I'm trying to load the Terms and Conditions on the Checkout page via a cms/page block. (SALES -> Terms and Conditions -> new condition -> Content)

{{block type="cms/page" page_id="agb"}}

I'm using this code on a second store as well and it's working just fine. I checked the permissions at System -> Permissions -> Blocks.

cms/page is set to allowed. I tried loading the page on this way on a normal page and that works just fine.
I had a look into the PHP Error log and there is no error what so ever. Browser console is free of errors as well.
At the moment it just gives back the code in the checkout I put in to the content field.


texts: Magento 2: Order Items in New Order Email not showing

texts:
When I get new order email after successful checkout, there is no information about order items. Need your help.

order_new.phtml

{{template config_path="design/email/header_template"}}

{{trans "%customer_name," customer_name=$order.getCustomerName()}}

            {{layout handle="sales_email_order_items" order=$order area="frontend"}}
            {{var myvar8 |raw}}

        &nbsp;

{{trans "Payment Method"}}

            {{var payment_html|raw}}

{{template config_path="design/email/footer_template"}}


texts:
I am new to Magento. But i got a requirement. Below is the requirement:

On the Frontend, user is having an option to select the theme from a given list of themes (Drop Down).
Upon selecting a theme, the selected theme should be applied to the store dynamically.

Please help me with an example, how to implement this feature.


texts:
On the cart page I'd like to fill the large white space with the widgets highlighted.

I currently have them put into the page with a Widget set to the main content area.

Is there an easy was to rearrange this?


texts: For what we need Account => MY APPLICATIONS

texts: Not once in practice not see that this functionality is used, what it is?


texts: Elasticsearch + Nginx + Proxy? - Magento 2.3.1

texts:
I'm installing Elasticsearch on my Ubuntu 18.04 under nginx for my Magento 2.3.1. Reading the official documentation, I find the following link, and says that to configure elasticsearch with nginx on the same server I must configure a proxy on my nginx, but I am not clear if this is necessarily necessary or not, can someone help me understand the reason and How to do it optimally?

https://devdocs.magento.com/guides/v2.3/config-guide/elasticsearch/es-config-nginx.html


texts: ' Tax Calculation Method Based On' - what is the preferred setting?

texts:
I have a store that is configured to store product prices as inclusive of tax. In the tax configuration, I have 'Tax Calculation Method Based On' set to Total.

On some orders that have discounts, I have noticed strange rounding issues. For example, an order that contains 3 lines, totalling £290, with a discount of £65, has one of the order lines with a line total of £55.01, instead of £55 (which is the correct product price) - making the order total £225.01, rather than £225.

What is the cause of the above, and can changing the 'Tax Calculation Method Based On' setting influence this?


texts: How can we make purchase order optional in magento 2.1?

texts:
Is there a way to make the purchase order number in the checkout page optional?
without filling purchase order number text field, I want to place an  order.


texts:
I am new enough to Magento and am just trying to create my first module to show all Categories but am having some issues. However I am not sure if it is due to my environment or if there is something else causing the issue.

Below are all my files and their directories. I am using Magento 2.1.11.

When I have these locally (WAMP on windows) I can enable the module and it appears as enabled under 'Stores'->'Configuration'->'Advanced' but I go to http://127.0.0.1/{root}/showCategories and all I can see is an empty page instead of the test echo in showCategories.phtml although I can see in the console that the <body> has a class="showcategories-index-index".

I thought this might just be something weird locally on WAMP but tried uploading it to my live server, however, my company is using shared hosting and I can't run commands like php bin/magento setup:upgrade so went to {root}/app/etc/config.php file and added the line to the array to enable the module, but this seems to just break the whole Magento installation.

Any help or advice with this would be greatly appreciated.

{root}/app/code/{mycompany}/showCategories/etc/module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
        <module name="{mycompany}_showCategories" setup_version="0.0.1" active="true"/>
    </config>

{root}/app/code/{mycompany}/showCategories/composer.json

{
    "name": "{mycompany}/showCategories",
    "description": "showCategories Module",
    "type": "magento2-module",
    "version": "1.0.00"
    "require": {
        "php": ">=5.5.22|~5.6.0|7.0.2|7.0.4|~7.0.6",
        "magento/framework": "100.0.*|100.1.*"
    },
    "repositories": {
        "typ2: "composer",
        "url": "https://repo.magento.com/",
    },
    "minimum-stability": "stable",
    "autoload": {
        "files": [
            "registration.php"
        ],
        psr-4: {
            "{mycompany}\\showCategories\\": ""
        }
    }
}

{root}/app/code/{mycompany}/showCategories/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    '{mycompany}_showCategories',
    __DIR__
);
?>

{root}/app/code/{mycompany}/showCategories/Controller/Index/index.php

<?php
namespace {mycompany}\showCategories\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action
{
    public function execute()
    {
        $page = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        return $page;
    }
}
?>

{root}/app/code/{mycompany}/showCategories/etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="showCategories" frontName="showCategories">
            <module name="{mycompany}_showCategories" />
        </route>
    </router>
</config>

{root}/app/code/{mycompany}/showCategories/view/frontend/layout/showCategories_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="showCategories_index_index" template="{mycompany}_showCategories::showCategories.phtml">
            </block>
        </referenceContainer>
    </body>
</page>

{root}/app/code/{mycompany}/showCategories/view/frontend/templates/showCategories.phtml

<?php
// test
echo 'showCategories';
?>


texts:
we have some 1000 products in site.

for some products we uploaded 1, for some2 .... for some 5 images.

if we upload only one image, than for that image we selected small, base, thumbinal in backend

we exported all products using system > import/export> export all produts.

but in csv under small, base, thumbinal columns , we can see that image name.

its going to be manual process if we check like this.

is there any way we can find the products with only one image


texts:
How to get magento collection by next condition:

where (url_from = "1" AND url_to = "2")
OR    (url_from = "2" AND url_to = "1")

Thank you!


texts: Remove Configurable Product in Listing for Edit Order

texts: Can anyone help me with how to alter this template? I want is to remove all configurable product in listing in Editing Order.


texts: How to get enabled configurable products which has associate products without inventory? [Magento 2]

texts:
My Query is: I want to get enabled configurable products which has associate products without inventory OR child products of enabled config products have inventory zero.

Use below code for filter out of stock Simple/Config products [magento 2 out of stock enabled configurable products]

$objectManager = $bootstrap->getObjectManager();

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

$state->setAreaCode('frontend');

$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');

$collection = $productCollection->create();

$collection->setFlag('has_stock_status_filter', true);

$collection =
        $collection->addAttributeToSelect('*')
->addAttributeToSort('created_at', 'DESC')
->joinField('qty',
        'cataloginventory_stock_item',
        'qty',
        'product_id=entity_id',
        '{{table}}.stock_id=1',
        'left'
    )->joinTable('cataloginventory_stock_item', 'product_id=entity_id', ['stock_status' => 'is_in_stock'])
    ->addAttributeToSelect('stock_status')
    ->addFieldToFilter('stock_status', ['eq' => 0])
    ->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
    ->addAttributeToFilter('type_id', ['eq' => 'configurable'])->load();

foreach ($collection as $product) {
    echo 'Config Product SKU: '.$product->getSku()."\n\n";
}

Note: Change $collection->addAttributeToFilter('type_id', ['eq' => 'configurable']) as per your requirements.

MySQL Query as follows:

SELECT e.*, at_qty.qty, cataloginventory_stock_item.is_in_stock AS stock_status, IF(at_status.value_id > 0, at_status.value, at_status_default.value) AS status FROM catalog_product_entity AS e
LEFT JOIN cataloginventory_stock_item AS at_qty ON (at_qty.product_id=e.entity_id) AND (at_qty.stock_id=1)
INNER JOIN cataloginventory_stock_item ON (cataloginventory_stock_item.product_id=e.entity_id)
INNER JOIN catalog_product_entity_int AS at_status_default ON (at_status_default.row_id = e.row_id) AND (at_status_default.attribute_id = '94') AND at_status_default.store_id = 0
LEFT JOIN catalog_product_entity_int AS at_status ON (at_status.row_id = e.row_id) AND (at_status.attribute_id = '94') AND (at_status.store_id = 14) WHERE ((cataloginventory_stock_item.is_in_stock = 0) AND (IF(at_status.value_id > 0, at_status.value, at_status_default.value) = '1') AND (e.type_id = 'configurable')) AND (e.created_in <= '1589313000') AND (e.updated_in > '1589313000') ORDER BY e.created_at DESC;


texts:
I'm new to M1.
I'm trying to add a new custom option type in product

My Config

<?xml version="1.0"?>
<config>
<modules>
    <CompanyName_ModuleName>
        <version>0.1.0</version>
    </CompanyName_ModuleName>
</modules>
<global>
    <blocks>
        <adminhtml>
            <rewrite>
                <catalog_product_edit_tab_options_option>CompanyName_ModuleName_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option</catalog_product_edit_tab_options_option>
            </rewrite>
        </adminhtml>
        <modulename>
            <class>CompanyName_ModuleName_Block</class>
        </modulename>
    </blocks>
    <catalog>
        <product>
            <options>
                <custom>
                    <groups>
                        <modulename translate="label" module="modulename">
                            Special Types
                            <render>CompanyName_ModuleName_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Stone</render>
                            <types>
                                <stone translate="label" module="modulename">
                                    Stone
                                </stone>
                            </types>
                        </modulename>
                    </groups>
                </custom>
            </options>
        </product>
    </catalog>
    <models>
        <catalog>
            <rewrite>
                <product_option>CompanyName_ModuleName_Model_Catalog_Product_Option</product_option>
            </rewrite>
        </catalog>
    </models>
    <catalog_product_view>
        <reference name="product.info.options">
            <action method="addOptionRenderer">
                <type>stone</type>
                <block>modulename/catalog_product_view_options_type_stone</block>
                <template>companyname/modulename/catalog/product/view/options/type/stone.phtml</template>
            </action>
        </reference>
    </catalog_product_view>
</global>
<frontend>
    <routers>
        <CompanyName_ModuleName_Router>
            <use>standard</use>
            <args>
                <module>CompanyName_ModuleName</module>
                <frontName>modulename</frontName>
            </args>
        </CompanyName_ModuleName_Router>
    </routers>
</frontend>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <companyname_modulename after="Mage_Adminhtml">CompanyName_ModuleName_Adminhtml</companyname_modulename>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
</config>

My Block

class CompanyName_ModuleName_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Stone extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract
{
public function __construct()
{
    parent::__construct();
    $this->setTemplate('companyname/modulename/catalog/product/edit/options/type/stone.phtml');
    //var_dump($this->hasData('template'));exit;
    $this->setCanEditPrice(true);
    $this->setCanReadPrice(true);
}
}

In my phtml file I var_dump something to test but it doesn't work. var_dump in the block works. And i put my phtml in

  design/adminhtml/default/default/template/companyname/modulename/catalog/product/edit/options/type/stone.phtml

Did I do somthing wrong? Any help would be very appreciated.

Thanks.


texts: Difference between _module.less and _extend.less

texts:
Is there any difference between extending a theme using _module.less and _extend.less? And what is the best practice when extending a module/theme?

My first thought was it's better to use _module.less when styling a new module, and _extend.less when extending a module. But Luma uses _module.less when extending the blank theme so that theory has gone out the window.

The only difference I can see between them is _module.less is imported before the responsive library and _theme.less where as _extend.less is imported after them.

This is the order they are imported in vendor/magento/theme-frontend-blank/web/css/styles-l.less

//
//  Blank theme desktop styles
//  _____________________________________________

//  These desktop styles are added to mobile

//
//  Global lib + theme styles
//  ---------------------------------------------

@import '_styles.less';
@import (reference) 'source/_extends.less';

//
//  Magento Import instructions
//  ---------------------------------------------

//@magento_import 'source/_module.less'; // Theme modules
//@magento_import 'source/_widgets.less'; // Theme widgets

//
//  Media queries collector
//  ---------------------------------------------

@import 'source/lib/_responsive.less';

@media-target: 'desktop'; // Sets target device for this file
@media-common: false; // Sets not to output common styles

//
//  Global variables override
//  ---------------------------------------------

@import 'source/_theme.less';

//
//  Extend for minor customisation
//  ---------------------------------------------

//@magento_import 'source/_extend.less';


texts: Magento 2 Admin Form add parameter to form submit url

texts:
I need to add a parameter from the registry to my form save action

Currently i'm attempting to do this by storing my parameter in the registry, then collecting it in the the buttons save block class. This works in as far as it changes the on-click event of the button, but does not affect the submit url of the form. Therefore when it comes to retrieving the order_id in the save controller the parameter is not there.

<?php

namespace Blah\OrderResources\Block\Adminhtml\Buttons;

use Blah\OrderResources\Block\Adminhtml\Buttons\Generic;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class Save extends Generic implements ButtonProviderInterface
{
    /**
     * get button data
     *
     * @return array
     */
    public function getButtonData()
    {
        $orderId = $this->getOrderId();
        // Add the order id to the url so we can maintain the association
        $url = $this->getUrl('order-resource/form/save', ['order_id' => $orderId]);

        return [
            'label' => __('Save Resource'),
            'class' => 'save primary',
            'data_attribute' => [
                'mage-init' => ['button' => ['event' => 'save']],
                'form-role' => 'save',
            ],
            'sort_order' => 90,
            'url' => $url
        ];

    }

}

I imagine that this needs to be done using a data provider but I can't seem to be able to figure this out. Here is the ui-component xml where the submit url is set :

<dataSource name="order_resources_form_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">Blah\OrderResources\Model\DataProvider</argument>
            <argument name="name" xsi:type="string">order_resources_form_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">resource_id</argument>
            <argument name="requestFieldName" xsi:type="string">resource_id</argument>
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="submit_url" xsi:type="url" path="order_resources/form/save"/>
                </item>
            </argument>
        </argument>
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
    </dataSource>

Does anyone know how I can achieve this ?


texts: Collection of custom attributes returns only first element in the template

texts:
I have written a function in the which returns a collection of a custom attributes:
public function getDownloadableAttributes()
    {
        $product = $this->getProduct();
        $file_0 = $product->getCustomAttribute('downloadable_file');
        $file_1 = $product->getCustomAttribute('downloadable_file_1');
        $file_2 = $product->getCustomAttribute('downloadable_file_2');
        $file_3 = $product->getCustomAttribute('downloadable_file_3');
        $file_4 = $product->getCustomAttribute('downloadable_file_4');
        $file_5 = $product->getCustomAttribute('downloadable_file_5');
        $file_6 = $product->getCustomAttribute('downloadable_file_6');
        $file_7 = $product->getCustomAttribute('downloadable_file_7');
        $file_8 = $product->getCustomAttribute('downloadable_file_8');
        $files = [$file_0, $file_1, $file_2, $file_3, $file_4, $file_5, $file_6, $file_7, $file_8];

        foreach ($files as $file) {
            if ($file) {
                return $file->getValue();
            }
        }
    }

Having a breakpoint on a return statement returns all the attributes, but calling this function in the block returns only the first element:
$product_downloadable_attributes = $block->getDownloadableAttributes();
<?=$product_downloadable_attributes?>

Not sure what's missing or what I'm doing wrong. Appreciate the help.


texts: Onepage checkout update payment section on radio button click

texts:
How can i update payment section if user click (check) radio button of payment.
So i want that magento safe the new selected payment method and reload the payment section.


texts:
I had a home page in my magento website that shows new products and a right column with specifiq widget.

But suddenly the home page shows nothing and the widget in right column is gone (I don't know exactly why but maybe because magento was updated to version 1.8)

Anyway I'm using this code in my magento home page

<!-- <reference name="content">
    <block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
    </block>
    <block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
    </block>
    <block type="reports/product_compared" name="home.reports.product.compared" template="reports/home_product_compared.phtml" after="product_viewed">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
    </block>
</reference>

-->

Thank you for helping


texts: Get order id after Paypal Express Checkout

texts:
I want an order Id  (not Increment Id) and quote after redirecting back from PayPal to my store.

For this purpose I am using sales_order_place_after event. But this event does not return order Id but getting an quote properly.

So is there any other events which I can use to satisfied my requirement ?


texts: is there any catalog product collection load related events in magento 2

texts:
I am trying to find the catalog_product_collection_load_before or catalog_product_collection_load_after events in Magento 2.
are there any relevant event handler in magento 2 to work with product collection?


texts: passing variables to static blocks for dynamic use

texts:
recently i had an opportunity to pimp some cms pages of a customer. While we were exchanging ideas, we cam up with something that as far as i know is not going to work out of the box.

The Goal is to create one static block that can receive up to 5 variables ( in this case product ids ). With those ids, the static block should render the products related to those and create html-snippets. It shall work like a static block, where you easily enter a couple of ids and the static block should show them in a proper way.

i thought of something like:

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="16" variables="3,5,28,29"}}

where 3,5,28,29 is a comma seperated List of ids which the block could render via php...

Is there any way to achieve this? It would help so much to combine and relate content pages with products.

I am helpful for any idea!


texts: Magento 2.2.7 Enterprise Edition Error in frontend | Invalid template file: '.../page/js/require_js.phtml' in module: '' block's name: 'require.js'

texts:
i have installed Magento 2 of version 2.2.7 EE and 2.2.6 CE. After installing i am getting this error in frontend and admin panel as well.

Errors i am getting:

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'D:/xampp/htdocs/mage227ee/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js'

or

Blank page

My current System:-

Windows 8
XAMPP /php 7.1.26 /MariaDb 10.1 /Apache 2.4
8GB RAM

I have tried multiple attempts of command with:

php bin\magento or php bin/magento
setup:upgrade
setup:static-content:deploy -f
indexer:reindex
setup:di:compile
cache:flush

Then i tried with the following approaches:

composer update
increased memory limit in index.php by adding ini_set('memory_limit', '2048M');
increased memory limit in user.ini, .htaccess and other locations as well.
No errors found in error.log and access.log in apache2/log folder.

Can anyone help me a on how to approach to solve it.
thank you.


texts: Magento 'adminhtml/session' addError / addSuccess rendering on incorrect pages

texts:
I'm running Magento 1.7.0.2 and have noticed strange behavior with the adminhtml/session messaging system:

Mage::getSingleton('adminhtml/session')->addSuccess("Message"); //or addError();

If you have two pages open in the backend and page 1 calls this function, upon refreshing page 2 (granted that this is done prior to page 1 completing it's refresh), the message will be rendered on page 2.

How to reproduce:

Refresh all caches (System → Cache Management → Select All → Refresh
Immediately open Magento's order page (Sales → Orders)

You'll now notice that the Orders page has the success message rendered, something along the lines of:

  9 cache type(s) refreshed.

See the image below where this message is rendered on the Orders page

Has anybody else experienced this behavior? I'm trying to establish whether this is brought about by my specific instance of Magento as a result of third party extensions or whether it exists in Magento's core.

If the latter, does anybody perhaps know of a fix for this? I know it may not seem very high priority, but there are instances where this behavior could be detrimental to site functionality.


texts: Set Magento Config Data For Script Duration Only

texts:
Is it possible to set a Magento configuration option for the duration of a single script only?

I'm trying to programatically and recursively create orders in Magento. I want to enable the Flat Rate Shipping method and set the cost to 5.00, for example. Once the script has run, I want the value to be set via persistence as usual from the db.

I am using a basic function to determine which iteration we're on. If it's the first, set the shipping method. The script is called via AJAX.

...
try {
    if (isFirstIteration($_iteration)) {
        $_flatShipping = Mage::getStoreConfig('carriers/flatrate/active', $_storeId);
        if ($_flatShipping == 0) {
            Mage::getConfig()->setNode('carriers/flatrate/active', '1');
            Mage::getConfig()->setNode('carriers/flatrate/price', '5.00');
        }
    }
} catch(Exception $e) {
    $html .= '
Error: ' . $e->getMessage() . '
';
}
...

That does not work; Magento throws the exception Please specify a shipping method  on quote save.

I can, however, set the shipping method in the db. This does work:

...
try {
    if (isFirstIteration($_iteration)) {
        $_flatShipping = Mage::getStoreConfig('carriers/flatrate/active', $_storeId);
        if ($_flatShipping == 0) {
            $_mageConfig = new Mage_Core_Model_Config();
            $_mageConfig->saveConfig('carriers/flatrate/active', '1', 'default', 0);
            $_mageConfig->saveConfig('carriers/flatrate/price', '5.00', 'default', 0);
            Mage::getConfig()->reinit();
            Mage::app()->reinitStores();
        }
    }
} catch(Exception $e) {
    $html .= '
Error: ' . $e->getMessage() . '
';
}
...

I'm guessing Magento's setNode doesn't work the way I think it does. Any info would be helpful, except bashing me for creating orders like this :) Thanks.


texts: Some function of Category collection is not workiing in 1.8

texts:
I used Category Collection but is show error in product count is fixed it but after that is show error in Set product is and attribute set.
I am trying this by Problematically.
My code:
$storeId = $_SESSION["store_id"] ? $_SESSION["store_id"] : $this->session->userdata('store_id');

public function get_categories()
{
    $storeId = store_id;
    $web_id = website_id;
    $rootCategoryId = Mage::app()->getStore($storeId)->getRootCategoryId();
    $categories = Mage::getModel('catalog/category')
        ->getCollection()
        ->setStoreId($storeId)
        ->addFieldToFilter('is_active', 1)
        ->addAttributeToFilter('path', array('like' => "1/{$rootCategoryId}/%"))
        //->setProductStoreId($storeId)
        ->addFieldToFilter('store_id',$storeId)
        // ->setLoadProductCount(1)
        ->getSize(1)
        // ->addAttributeToSelect('*')
        // ->addAttributeToSelect(array('name'),'inner')
        ->addAttributeToSelect(array('name','url'));

    foreach ($categories as $_category)
    {
        $img = $_category->getImageUrl();
        $data[] = array('category_id' => $_category->getEntityId(), 'category_name' => $_category->getName(), 'image' => $imgUrl);
    }
    return $data;
}

Now this code is showing Fatal error: Call to a member function addAttributeToSelect() on a non-object


texts: Option to Upload Image on Cart Page With Each Product

texts:
I have to create an upload image option on the cart page with each cart product. If a user uploads an image using this option it should display uploaded image with the product and also visible in the admin panel after successful checkout.

Please let me know how do I achieve this functionality? Any help would be greatly appreciated.

Thank You


texts: Which tables are affected in Magento 1.9 when I empty the cart?

texts:
I am working with a Magento 1.9. I had added some products (Simple products) to my cart as a logged in user and saved it for checkout it later. But I haven't placed it as an order. I empty that cart.

Which are the tables affected by this process while I am emptying the cart? There is no changes in sales_flat_quote and sales_flat_quote_items, after doing this .But it is removed from my cart. How does Magento know that my cart is empty? Please help me.

Thanks in advance!


texts: Setting price for an item in quote programatically

texts:
I get the price of the item from external system and I want to update the price of the item in the quote programmatically.

I have this piece of code:

    foreach ($items as $item) {
        ...
        $price = getPriceFromSap($item->getProductId);
        $item->setPrice($price);
    }   $quote->save();

after that the price is updated correctly in the database, but if I open the cart from the front-end the price is restored to the previous wrong price.
What I did wrong?


texts: Magento with Varnish - var/cache folder still being used

texts:
I have a Magento store configured with Varnish. When everything is up to date site is fast. If I change something in the backend it doesn't get reflected on frontend unless I manually delete var/cache/mage--* folders.
By the looks of the documentation, this folder should be empty after I configured Varnish.
How do I debug this?


texts:
After a search i find this solution but i think it doesn't work correctly.

0 20 * * 7


texts: How to remove a product's attribute value

texts:
I am updating produts programmatically and it sometimes happens that an attribute for a product is not used anymore. In that case, the attribute value should of course be removed. However, I can not find a way to do that. The update works just fine, but values aren't getting removed from the model.

I have looked around a bit and it seemed that the following would be the solution:

$product->unsetData($attributeCode);

But this does not remove the value. The attribute code is correct and everything else works perfectly fine. I also checked and it does use the right store.

I have gotten suggestions on doing this directly through the database, but I'd rather do it on the model for safety.


texts: Add to Cart button redirects to empty cart on category view page

texts: Since I updated our version of Magento to 1.9 every time I click the Add to Card button on the category view page I get redirected to the empty shopping cart. What have we done wrong while updating?


texts:
I'm trying to create very simple thing - when user goes to URL http://example.com/brands/brand_name it should show a brand page that should be created based on .phtml template.

I have already added a router and successfully matched the URL:

class My_Module_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
{

    public function match(Zend_Controller_Request_Http $request)
    {
        // let's assume that URL is http://example.com/brands/adidas

        $pageId = $request->getPathInfo(); // "brands/adidas"
        $params = trim($pageId, '/');
        $params = explode('/', $params); // array(brands, adidas)

        if($params[0] === 'brands') {

            // Here I need somehow to create brand page based on custom template (.phtml file that I already built)

            return true;
        }

    }

}

Please help me to understand how to tell Magento to print the template phtml file that I need.

Thank you!


texts: Index management - most crucial factors of indexing time

texts:
What are the most important factors which affects the time of indexing ...

product attributes
product prices
catalog url rewrites

and also the indexes for flat tables.

I know that the number of products and categories are important, but I want some advices about optimizing them and reduce the indexing time.

Also I want to know whether the index management gets better in magento 1.8 ce, rather 1.6.

Any advice is appreciated!


texts: Magento 2: How to sort products by price then by name?

texts: The reason I'm asking this is that all my products have configuration and I have to display only simple products (configurable products not visible). However when I sort by price, the products belongs to the same configuration got scattered all over the place. After sorting by price, I want to sort my product by name within the same price range. Is this achievable?


texts: Magento 2.3.4 - 5 Not working with PHP 7.2 - 7.3 but working fine on PHP 7.1

texts:
Could you please someone help me I have newly setup VPS server as per Magneto 2 requirement i need PHP 7.2 or 7.3 to run Magneto 2.3.4 - 5.

But i m getting error when i m running Magneto 2.3.4 on PHP 7.3 other way Magneto 2.3.4 working fine on PHP 7.1 which is totally baseless.

Is there someone facing same issue can someone help me where i m doing wrong on new VPS server?


texts: Multiple Forms that need to send their own email templates

texts:
I've been searching around and cannot find a solution that works or fully explains how to set up multiple email templates each for its own form. All of my companies clients have multiple forms with different fields and need different information attached to this template. However all of our forms just use the template attached to the Contact Us form is using from the admin.

Any help would be appreciated.


texts: How do I change the product page active tab on page load?

texts:
When my product page loads the first tab is active:

How do I get the 2nd tab to be active on page load, so it looks like this?


texts: Magento 2 - Filter through non anchor categories throws "The bucket doesn't exist." exception

texts:
I am facing this issue on M2.3.5-p2 when filter through non anchored subcategory on the main category(anchored) page.
Steps to reproduce

From the admin set parent category anchor to Yes.

For one of it's subcategory set anchor to No.

Now on the front end navigate to main category and on the layered navigation try to filter through sub category configured as non anchor.

It will throw the exception "The bucket doesn't exist."
Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.

Check the screenshot

There are several post available related to it which only consists a workaround. Instead what is the root cause of the issue?Why magento won't allow to filter through non anchor categories.
Please help me with this.
Thanks in advance.


texts: Tax Rules for customer groups on selected products

texts:
I have a special needs equipment website, and the UK Tax office have made some items VAT (Tax) exempt, but not to everyone. The customer needs to fill in a form to prove they have a disabled child and send it back to us, so they don't have to pay tax on selected products.

So I need to be able to create a customer group that does not have to pay Tax on selected products.

does anyone know if its possible and if so how?


texts: Can't login to Magento admin using Vagrant box

texts:
I'm trying to set up a local dev environment using Vagrant and the Vaprobash script since I've used it before in several PHP based applications but for some reason I'm not able to login to the admin area.

I'm using this Vagrantfile and my fork of Vaprobash which only changes the nginx repo to use the 1.7 version so I end up with:

Nginx 1.7
PHP 5.5
MySQL 5.6

Which should be fine considering the system requirements for Magento 1.9.

I think it might be related to this answer in SO however I've tried several ways to fix it without luck:

I tried using Apache 2.2 instead of Nginx.
I'm not using localhost or any other one-word domain name, I tried using the IP of the virtual box and also mapped a magento.local.dev domain in my hosts file.
I tried storing sessions in files and database, both are getting stored just fine so it doesn't seem like a permissions issue.
I tried commention out the $cookieParams lines in the Varien.php file and it didn't work so it might not be related to the cookies.
I tried running the installer from the web interface, command line and the magerun script.
I ran the magerun sys:check command and everything returned green.

There was a moment where I could make it work but I'm not exactly sure what I did because I was trying so many things, I remember opening incognito mode in Chrome, clearing the cookies and login in just fine but I destroyed the box to se if I could reproduce it and I couldn't.

I've managed to set it up using a much simpler script however I'm not sure what the difference might be, maybe it's because I'm using php-fpm but I've seen it work with Magento before. I'm thinking it might be some server setting or something like that but I can't see what it might be.

EDIT: I just noticed I can't add products to the shopping cart from the frontend, it could be part of the same problem.


texts: How to show out of stock accosiative product of configrable product

texts: How can i show all options of configurable products even if any (associative) product is out of stock, it should show the option but not selectable


texts: setting a observer after saveOrderAction - which event do I choose and how do I locate it?

texts:
We use Onepage checkout in Magento 1.4

The file where the work is done is:

/app/code/core/Mage/Checkout/controllers/OnepageController.php

The function is saveOrderAction()

I want to perform an action after the order has been saved, but a) I don't see any dispatchEvent call in this function and b) I don't know which event to use or to search for.

I have seen exhaustive event lists for Mage 1.x, but I don't know how to correlate to this method.

I also need to know how to add the <observer> XML and place the function, as I have never done this before.


texts:
There is no PERMISSION in the drop down options if I click on Reports in the admin-panel .

Am i missing something?


texts: We have a attribute 'short-description' in our product listing page. We want to escape html characters e.g. "&" => "&amp;" , and append information to it when our admin hit 'save' in product editing page. Which file / method should I be looking into?


texts:
Im using the datapump API - it works fine with my products, but now with updating images it wont work.

This is my array that Magmi doesnt like

array(8) {
  ["type"]=>
  string(6) "simple"
  ["sku"]=>
  string(6) "131017"
  ["image"]=>
  string(73) "/media/sdc3/wwwroot/site/public/importer/../import/NO/A_131017.jpg"
  ["small_image"]=>
  string(73) "/media/sdc3/wwwroot/site/public/importer/../import/NO/A_131017.jpg"
  ["thumbnail"]=>
  string(73) "/media/sdc3/wwwroot/site/public/importer/../import/NO/A_131017.jpg"
  ["image_label"]=>
  string(8) "A_131017"
  ["small_image_label"]=>
  string(8) "A_131017"
  ["thumbnail_label"]=>
  string(8) "A_131017"
}

(the path to the images are correct, and working)

When I imported my products, this worked fine, but there were descriptions etc. on

I have the following magmi settings:

using mode - Update existing items only,skip new ones
Image import mode - override existing images
Pre-download check for remote images - enabled
Assign only existing images - no

My profile is also correct


texts: How to return store admin variables in magento2

texts:
how simple would it be to do as in magento1

 Mage::getStoreConfig('general/store_information/name')


texts:
After clearing the cache default_head_blocks.xml doesn't update.
How I clear the cache
1. php bin/magento setup:static-content:deploy

2. Flush Magento Cache in the admin

What is the best way to clear magento 2 cache?
Thanks for your help.


texts:
Hi I'm wondering if there are any disadvantages when using persistent shopping cart in magento? If I do enable this are people forced to create an account and no longer check out as guests ?
Thanks


texts:
i am working with magento(1.9), the pagination is not properly working for ul li tag.

**code in phtml file**

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

Articles

            <?php if($collection->getCount()) {
                foreach($collection as $_collection) { ?>

                            <?php if($_collection->getImagePath()!='') {
                                    $image = explode("/",$_collection->getImagePath());
                                    $image_name = array_pop($image);
                                    $image_path =  implode("/",$image);
                                    $image = Mage::helper('flphotos')->resizeImage($image_name, 140,140, $image_path);
                                }  ?>

                                <img src="<?php echo $image ; ?>" width="140" height="140">

                                <a href="<?php echo $this->getUrl('article/article/detail',array('_query'=>array('id'=>Mage::helper('flphotos')->Encrypt($_collection->getArticleId())))); ?>" title="Title"><?php echo $_collection->getTitle() ; ?>

                                    <?php echo $_collection->getDescription() ?>

 <?php echo $_collection->getLikeCount(); ?><?php echo $this->__('Likes'); ?>

            <?php } } echo $this->getPagerHtml(); ?>

**code is block file**

protected function _getArticleModel() {
        return Mage::getModel('flarticle/article');
    }

    public function __construct()
    {
        parent::__construct();
        $collection = $this->_getArticleModel()->getAllArticle($this->getRequest()->getParam('userid'));
        $this->setCollection($collection);
    }

    public function getPagerHtml()
    {
        return $this->getChildHtml('pager');
    }

    protected function _prepareLayout()
    {
        parent::_prepareLayout();
        $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
        $pager->setAvailableLimit(array(5=>5,10=>10,20=>20,'all'=>'all'));
        $pager->setCollection($this->getCollection());
        $this->setChild('pager', $pager);
        $this->getCollection()->load();
        return $this;
    }

Mysql image


texts: Programatically get special price products that are active by checking the end date?

texts: How can I programmatically get products that has an active special price? (by checking the end date).


texts: catalogsearch Layout will not load secondary design

texts:
I have a category with an ID of 12 and an ID of 15. In category settings category 15 has a custom design of mylayout_default and category 12 has a custom design of mylayout_design2. The difference in the two designs is catalog/product/list.phtml.

When I browse to category 15 it loads the default layout of mylayout_default, as it should. When I browse to category 12 it loads the design2 layout, as it should.

The Problem

When I search I need the same rules to apply and they don't. Let's say the search URL is /catalogsearch/result/?cat=15&q=show me some results. The default layout is loaded. However, when I search category 12 (/catalogsearch/result/?cat=12&q=show me some results) the layout does not update to design2.

In catalogsearch.xml I can modify the block to <block type="catalog/product_list" name="search_result_list" template="../../design2/template/catalog/product/list.phtml"> but that only works if I modify the default layout file (not design2) and it, of course, applies globally rather than just a single category.


texts: How can I get my controller to update a block via Ajax?

texts:
I'm trying to write a module that adds a finance section on my product pages. I've managed to get the initial block to show, but on page-load I'm trying to get it to populate the box with finance information from another block via a controller.

I've set up my XML file that is correctly loading in the content on my product page:

<layout version="0.1.0">
    <default>
        <reference name="content">
        </reference>
    </default>
    <finance_ajax_index>
        <reference name="content">
            <block type="finance/finance" name="finance" as="finance" template="finance/init.phtml"/>
        </reference>
    </finance_ajax_index>
    <finance_ajax_ajax>
        <remove name="right"/>
        <remove name="left"/>
        <block type="finance/finance" name="finance_ajax" as="finance_ajax" template="finance/ajax.phtml" output="toHtml"/>
    </finance_ajax_ajax>
</layout>

My AjaxController.php has been set up as follows:

<?php class Eden_Finance_AjaxController extends Mage_Core_Controller_Front_Action {

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

    public function ajaxAction() {
        $isAjax = Mage::app()->getRequest()->isAjax();
        if ( $isAjax ) {
            $layout = $this->getLayout();
            $update = $layout->getUpdate();
            $update->load( 'finance_ajax_ajax' );
            $layout->generateXml();
            $layout->generateBlocks();
            $output = $layout->getOutput();
            $this->getResponse()->setHeader( 'Content-type', 'application/json' );
            $this->getResponse()->setBody( Mage::helper( 'core' )->jsonEncode( array( 'outputHtml' => $output ) ) );
        }
    }

}

and I'm using the following in my init.phtml to try and load the ajax content from ajax.phtml, but when logging data, all I get is {"outputHtml":""}:

<script>
    function getFinance() {
        var months = $j("select[name='finance']").val();
        $j.ajax({
            beforeSend: function() {
                $j('.loader').show();
            },
            url: "<?php echo $this->getUrl('finance/ajax/ajax');?>",
            type: "POST",
            dataType: 'json',
            data: {
                id: <?php echo $_product->getId();?>,
                months: months
            },
            success: function (data) {
                console.log(data);
                $j('#finance_example').html(data.outputHtml);
            },
            complete: function(){
                $j('.loader').hide();
            }
        });
    }
    $j(document).ready(function() {
        getFinance();
        return false;
    });
    $j("select[name='finance']").change(function() {
        getFinance();
        return false;
    });
</script>

No matter what I change, I can't seem to get any output from the controller.


texts: Create observer on "email_shipment_set_template_vars_before" and set template vars

texts:
I have created a observer on "email_shipment_set_template_vars_before"
& trying to set some template var but its not working.
any thoughts ?
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Mod\Sales\Observer;

use Magento\Framework\Event\ObserverInterface;
use Psr\Log\LoggerInterface;
use Magento\Sales\Model\Order\Email\Container\Template;

class ShipmentSender implements ObserverInterface
{
    /**
     * @var \Psr\Log\LoggerInterface
     */
    protected $logger;

    /**
     * @param \Psr\Log\LoggerInterface $logger
     */
    public function __construct(LoggerInterface $logger,Template $templateContainer)
    {
        $this->logger = $logger;
        $this->templateContainer = $templateContainer;
    }

    /**
     * @param Observer $observer
     * @param Template $templateContainer
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $transport = $observer->getEvent()->getTransport();
        $shipment  = $transport['shipment'];
        $order  = $transport['order'];
        $justshipped = '45';
        $shipped = '99';
        $transport['shipment'] = $shipment;
        $transport['justshipped'] = $justshipped;
        $transport['shipped'] = $shipped;
        $this->templateContainer->setTemplateVars($transport);
    }
}

adminhtml/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="email_shipment_set_template_vars_before">
        <observer name="shipment_sender" instance="Mod\Sales\Observer\ShipmentSender" />
    </event>
</config>


texts: Magento2: How to remove Paypal Credit button from product detail page?

texts:
I have enabled the "Display on Product Details Page" to "Yes" from admin section in paypal payment method, but I need only PayPal icon, not required PayPal Credit Icon on product page and other(cart page and mini cart).
I am not able to find any setting for this icon in admin, Can any one help me how to remove this from admin.


texts: Magento 2 css problem on fronted and backend

texts:
I have the following issue:

I copied a project from a server to another.

On the original server, everything works fine, but on the new server i don't have any css or js included in my project.

I run all the commands, like:

  php bin/magento setup:upgrade

  php bin/magento setup:static-content:deploy(on language) and default,

and reindex I deleted already all the pub folder and regenerated again, i also set the shop on the production mode.

I also did this:

Open up app/etc/di.xml and find the virtualType name="developerMaterialization" section. In that section you'll find an item name="view_preprocessed" that needs to be modified or deleted.

You can modify it by changing the contents from

  Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink to
  Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Delete the files under pub/static to get rid of any existing symlinks. You may want to be careful not to delete the .htaccess file.

I am run of ideas, why the css an js not working.
If i inspect the page, i recive 404 for all the css even the files are there.

For example:

I have 404 for this file

  http://mysite.hypernode.io/pub/static/version1499347283/frontend/Venustheme/namespace/nl_NL/Ves_BaseWidget/css/styles.css

If i acess this in browser i recive 404 but if i remove version149934728 for link and acessed again like this:

  http://mysite.hypernode.io/pub/static/frontend/Venustheme/namespace/nl_NL/Ves_BaseWidget/css/styles.css
  the files it's accessed

Does anyone know how can i solve this problem?


texts: Payment methods disappear after zip was entered and country was changed?

texts:
Magento 2.2.3

I am having some trouble with my payment methods in the checkout. The methods are shown when the checkout loads. Now when I enter the address details, they are still shown.

When I change the country now, they disappear. I tracked this down a bit and noticed, that the factor which makes them disappear is the zip. As soon as the zip was entered and the country is changed, the methods disappear.

The country is allowed for payment methods, thats not the problem. Any idea where I might start looking?

I am using the iWays PayPal+ extension.

Thanks!


texts: Can't get orer id from event sales_order_place_after

texts:
I'm trying to get order data (order id for now) from an observer using the event sales_order_place_after.

The event fires and does not get any errors, but my order_id is blank. Any help as to why this isn't working as I expect?

My events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_place_after">
        <observer name="PingOnSale" instance="Vendor\Module\Observer\PingOnSale" />
    </event>
</config>

My Observer

namespace Vendor\Module\Observer;

use Magento\Framework\Event\ObserverInterface;

class PingOnSale implements ObserverInterface
{
    /**
     * @param \Magento\Framework\Event\Observer $observer
     * @return bool
     */
    public function execute(\Magento\Framework\Event\Observer $observer){
        $order = $observer->getData('order');
        $order_id = $order->getId();
        // $order_id is blank when logging to file
        return true;
    }
}

I have also tried this method, that is the accepted answer from the question which did not work. According to the documentation, $observer->getData(); is the right way to do this.

The event dispatches from Magento\Sales\Model\Order and as far as I can tell my code should be getting the order. Here is the relevant code from the Order class.

public function place()
{
    $this->_eventManager->dispatch('sales_order_place_before', ['order' => $this]);
    $this->_placePayment();
    $this->_eventManager->dispatch('sales_order_place_after', ['order' => $this]);
    return $this;
}


texts:
I found this Display all Reviews On a Single CMS page in Magento 2  and i tried this code in block cms and i have data in review detail but there is nothing shown so why is't empty and can any one help me in this issue thanks in advance

here is the code display.phtml
i created a module with routes and simple controller and block


texts: Catalog price rules - update on schedule

texts: I have updated my web shop to Magento 2.4.2 version and i would like to set my cron job to update every 48h just for Catalog price rules (catalogrule_rule). Does anybody know how to do that?


texts:
I have search over every place but didn't got any valuable response.

Can anyone have idea how exactly magento handle import process.Even i have Download Sample File from magento import section.

Surprisingly,the provided Csv doesn't have any configurable product.

I never understand how magento hande configurable product.

Can any please guide here or any sample CSV.

Please provide tested csv i have used mandy from web but none of its working correctly.


texts: Magento 2 copy extension attribute value from quote to order

texts:
I have an extension attribute on quote address called "subdistrict".
The data is successfuly saved to quote_address.
But when completing the order, these data are not saved to sales_order_address.

below is my fieldset.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
    <fieldset id="sales_convert_quote_address">
        <field name="subdistrict">
            <aspect name="to_order_address" />
        </field>
    </fieldset>
</scope>

and my extensions_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
    <attribute code="subdistrict" type="string" />
</extension_attributes>
<extension_attributes for="Magento\Sales\Api\Data\OrderAddressInterface">
    <attribute code="subdistrict" type="string" />
</extension_attributes>

right now i am getting an error:

  "Error occurred during "shipping_address" processing. Error occurred during "extension_attributes" processing. Error occurred during "subdistrict" processing. Invalid type for value: "array". Expected Type: "string"."

and here is some part of the quote content:

  ["city"]=>
  string(14) "Kab. Tangerang"
  ["firstname"]=>
  string(7) "Yohanes"
  ["lastname"]=>
  string(7) "Pradono"
  ["customAttributes"]=>
  array(1) {
    ["subdistrict"]=>
    array(2) {
      ["attribute_code"]=>
      string(11) "subdistrict"
      ["value"]=>
      string(8) "Balaraja"
    }
  }
  ["extension_attributes"]=>
  array(1) {
    ["subdistrict"]=>
    array(2) {
      ["attribute_code"]=>
      string(11) "subdistrict"
      ["value"]=>
      string(8) "Balaraja"
    }
  }
  ["same_as_billing"]=>

and my mixin.js

define([
    'jquery',
    'mage/utils/wrapper',
    'Magento_Checkout/js/model/quote'
], function ($, wrapper, quote) {
    'use strict';

    return function (setShippingInformationAction) {

        return wrapper.wrap(setShippingInformationAction, function (originalAction) {
            var shippingAddress = quote.shippingAddress();
            if (shippingAddress['extension_attributes'] === undefined) {
                shippingAddress['extension_attributes'] = {};
            }

            // you can extract value of extension attribute from any place (in this example I use custom_attributes approach)
            // Don: the actual data to be sent to Magento backend is inside 'extension_attributes'
            console.log(shippingAddress);
            shippingAddress['extension_attributes']['subdistrict'] = shippingAddress.customAttributes['subdistrict'];
            // pass execution to original action ('Magento_Checkout/js/action/set-shipping-information')
            return originalAction();
        });
    };
});


texts:
When I activate the integrated Klarna module and try to buy items in the shop I get the following error message in the console:

Error: [object Object] customer-data.js:91:23

return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {
                throw new Error(jqXHR);
            });

The page loads forever and I cannot get to the checkout page.


texts: Magento2.3.2: All options are not showing in admin panel

texts:
When I tried to open the admin panel, admin is opening successfully.

But when I tried to open stores > configuration, all the options are not coming. When I reload, again and again, it's showing properly.

Please check the following :


texts: Is there a way to change the naming format for "quick simple product creation"

texts:
I've never been a fan of the naming format that the "quick simple product creation" offers you and wondered if there is a native way to tweak it without delving into the code?
For example if the configurable product name is

QWERT
and I create a simple product with the configurable options of Blue and XL it creates the name as

QWERT-Blue-XL

A preferred naming format would be Qwert (Blue/XL)

I know you can uncheck the name option and adjust to what you need but I'm looking for it to automatically stick to the format that I require.


texts: Magento 2 : Redirect customer to login page on email change

texts:
i want to redirect the customer to the login page when email id is changed from edit form ,i did below code
Issues :
1:  I am not getting redirected to login page, i can see message **Please Login now** also it show error message **customer could not be saved** where are details are getting saved.

2: I see below error :
Notice: Undefined property: Vendor\Magento\Observer\Customer\SaveObserver::$resultFactory

Please help me with same , should i write redirect code in afterExecute ?
My code as below
1: Observer
<event name="customer_account_edited">
    <observer name="customereditdone" instance="Vendor\Magento\Observer\Customer\SaveObserver" />
</event>

2: Observer code
<?php
namespace Vendor\Magento\Observer\Customer;

use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;

use \Magento\Framework\Controller\ResultFactory;

class SaveObserver implements ObserverInterface
{
    protected $_request;
    protected $_layout;
    protected $_objectManager = null;
    protected $_customerGroup;

     protected $_messageManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(
        \Magento\Framework\View\Element\Context $context,
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Framework\Message\ManagerInterface $messageManager
    ) {
        $this->_layout = $context->getLayout();
        $this->_request = $context->getRequest();
        $this->_objectManager = $objectManager;
        $this->_messageManager = $messageManager;

    }

    /**
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
     public function execute(EventObserver $observer)
    {

        $customer = $observer->getEvent();
        $email=$customer->getData('email');
        $cid=$customer->getData('entity_id');
        $oldemail = "" // get old email

    if($oldemail!=$email){

        $this->_messageManager->addSuccessMessage('Please Login now');
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        $resultRedirect->setUrl("customer/account/login/");
         return $resultRedirect;

    }

    }

}


texts: How Can I move the "Proceed to Checkout" button outside of the cart block?

texts:
So when you click on a product, you get taken to the cart page, in my layouts I have a sidebar included before the content, so i can get a two column layout.

I want the proceed to checkout button to be in the sidebar and not the content area with all the products, buttons etc..

This is what my sidebar include/block looks like:

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

           if(!$this->hasError())
           {
               ?>

                       <?
                           foreach ($this->getMethods('top_methods') as $method)
                           {
                               if ($methodHtml = $this->getMethodHtml($method))
                               {
                                   ?>

<?= $methodHtml; ?>

                                   <?
                               }
                           }
                       ?>

              <?
            }
        ?>

However When I tried this, i got an error saying that

Warning: Invalid argument supplied for foreach()  in /httpdocs/app/design/frontend/choice/default/template/page/html/checkout_process.phtml on line 12

I've spend the past 3 hours searching through google and stack overflow, but i've come up dry, could anyone explain what i need to do to move this button into another block? or direct me to a tutorial that will help?


texts: I need to increase all the prices in my store by a fixed percentage.  What would be the best way to achieve this?


texts: Api2 custom return value string, is not being returned

texts:
I am trying to get a custom value in the soap api2 response but have not managed to get it working. I do see it in the WSDL but can't get it to return in the response.

I rewrite the catalog_product_api_v2 model, so that I can rewrite the info().

<catalog>
  <rewrite>
    <product_api_v2>Disc_ApiExtended_Model_Product_Api_v2</product_api_v2>
  </rewrite>
</catalog>

info() does nothing more than just contain the parente::info() code and only adds a new value to the result array:

$result['full_url'] = $product->getProductUrl();
return $result;

When i Mage::log($result), I can see the result containing the full_url.

The wsdl.xml and wsi.xml are in my local extensions folder as well and add the new value. That works as well since I can see it in my WSDL.

<element name="full_url" type="xsd:string" minOccurs="0"/>

The above element is in the complexType node in the catalogProductReturnEntity .

The cache is cleared multiple times, from the cache/ folder and from the backend as well.


texts: 403 forbidden error while accessing magento connect manager in magento 1.8

texts:
I got 403 error in magento 1.8 admin while I trying to access magento connect manager under configuration->tools

I also try to re-save administration roles under configuration->permissions->roles . What should I need to do overcome this error ?


texts: Google Tag Manager conversions not reporting with built-in Magento Enterprise 1.14.2 GTM Package

texts:
I'm having an issue with the built-in GTM support in 1.14.2+.

We have enabled the GTM support
We have input the correct GTM container ID
We have enabled Enhanced Ecommerce in the Google Analytics package
We have set up Universal Analytics tagging on all page views in GTM
We have set up UA Conversion Tracking on the success page in GTM

However, we still do not get the UA conversion in GA. It never registers.


texts: Magento 2 Product Detail Page Image is not display it is Loading

texts: In my site product, details page image is not displayed still it will be loading. How to find out about this problem. Can you please help me? please find the screenshot https://prnt.sc/kdcff2


texts: how to save same tag model for all store views?

texts:
When trying to save tag model as following (assuming that $storeId = 0) :

    $tagModel = Mage::getModel('tag/tag');
    $tagModel->setName($tagName)
        ->setFirstCustomerId($customerId)
        ->setFirstStoreId($storeId)
        ->setStatus($tagModel->getApprovedStatus())
        ->save();

It is not visible to all other store views, is it possible to save on tag for all store views somehow ?


texts: In Magento 1.9 I want to apply tax per customer wise on cart page. Is it possible?


texts:
I've used the data migration tool to move from magento 1.6.2 into magento 2.2.7

I've some issues (mainly on backend) where it seems as if magento doesn't properly put text, instead it displays curly braces as the following image.

Any ideas on what is going on?

Thanks.


texts: Magento 1.9.3.2 coupon code active remove cash on delivery

texts:
I would like to remove cash on delivery payment method when coupon code is active.

Am crating a TEST50 coupon code in Shopping Cart Price Rule for discount 50%.

When TEST50 is active cash on delivery remove in checkout page. If  TEST50 is non-active show cash on delivery.


texts: How Magento\CatalogInventory\Model\Stock\Item can be replaced in Constructor (DI)

texts:
I want to use below code in Magento 2 constructor.

$stockItem = $objectManager->create('Magento\CatalogInventory\Model\Stock\Item');

Can any one tell me the right way of calling above create class into constructor as a dependency class?


texts:
I have this problem for a couple of years now and I don't know how to fix it.

When customers have something in the shopping cart and they want to delete it after some time, they sometimes get this error:

Fatal error: Call to a member function getProduct() on a non-object in /home/user../../CartController.php online 95

On line 95 on that file it says:

$productId = $this->_getCart()->getQuote()->getItemById($id)->getProduct()->getId();

Can somebody please help me? So the problem shows only after deleting a product after a while and not always.


texts: Whenever customer place order on cash on delivery i received this error can any one knows why this occur 'Uncaught TypeError: Argument 1 passed to Magento\\Sales\\Model\\Order\\Address\\Renderer::format() must be an instance of Magento\\Sales\\Model\\Order\\Address, null given,


texts:
I have a configurable product with 1 "child" product.

On "child" product Inventory, I only have 1 product for Qty, and the Stock availability became "out of Stock".

Now I just change the qty value to 10000, and Stock availability continues as "out of Stock" and this dropdown is disabled and I can not change this value.

I was "digging" on the code, and I found that is the configurable-type-handler.js that check if product is configurable or not, if not, the dropdown changes to disabled.

How can user change stock availability for "child" products?

Thank you


texts:
How to Edit PHTML template in Magento 2?

I am trying to Edit PHTML template in Magento 2.

  First I "Enabled Template Path Hints for Storefront" from Admin Panel.

Then I found that my template resides here "public_html/vendor/magento/module-checkout/view/frontend/templates/onepage.phtml". I went to that file and found below code there.

            <img src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"
                 alt="<?php /* @escapeNotVerified */ echo __('Loading...'); ?>"
                 style="position: absolute;">

I would like to edit PHTML template of Checkout Page. I would like to know   the location of the PHTML file of Checkout Page.


texts: magento 2 any type of emails is not working

texts: when user purchases an item, email is not going neither to the client nor to the admin. what should i do to make the emails working?


texts: Magento2: How to get adminUrl in js file using something like 'mage/url'?

texts:
I am trying to populate an adminhtml dropdown when another dropdown is selected using AJAX and 'mage/url' returns the frontend url. This is my code:

app/code/Namespace/Module/view/adminhtml/web/js/form/element/options.js

define([
    'underscore',
    'uiRegistry',
    'Magento_Ui/js/form/element/select',
    'mage/url',
    'Magento_Ui/js/form/form'
], function (_, uiRegistry, select, url, form) {
    'use strict';

    return select.extend({

        onUpdate: function (value) {
            var field1 = uiRegistry.get('index = type');
            var urlString = url.build('stannp/template/ajax');

            if (field1.value() == value) {

                jQuery.ajax({
                    url: urlString,
                    type: 'GET',
                    data: {type: value},
                    complete: function (data) {
                      //
                    },
                    done: function (response) {
                        console.log(JSON.parse(JSON.stringify(response.responseText)));
                    },
                    error: function (response) {
                        console.log(JSON.parse(JSON.stringify(response.responseText)));
                    }
                });
            }
            return this._super();
        },
    });
});

urlString returns stannp/template/ajax

I tried with BASE_URL too and by getting the current url and splitting it, but it doesn't work.
Thank you.


texts: Magento 2 : injecting models, interfaces in constructor magento

texts:
I'm new to magento 2 and I'm trying to understand how exactly injections work in magento.

I understand that injecting a model and interfaces is the right approach in magento 2.

But for some reason when I am trying to inject a model/interface, it throws me and error where as when I use objectManager to get an instance of it, it would work.

For example the below code throws me errors as soon as I inject the eav model or any customer related models or interface.

I was wondering if anyone could elaborate the reason or guide me in the right direction.

public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Eav\Model\Entity $entity
    ) {
        $this->_eavEntity = $entity;
        parent::__construct($context);
    }


texts: Magento 2: Warning: simplexml_load_string(): Entity: line 1: parser error : XML declaration allowed only at the start of the document

texts:
I am using magento 2.0 I have learn magento2 tutorials(No frills magento2 layout) of alan storm. I have create two xml files. when i run controller file then give Following error

Warning: simplexml_load_string(): Entity: line 1: parser error : XML declaration allowed only at the start of the document in C:\wamp\www\magentodemo\vendor\magento\framework\View\Model\Layout\Merge.php on line 488

my xml file is :

top-container.xml

<?xml version="1.0" encoding="UTF-8"?>
 <container name="top" > </container>

block.xml

  <?xml version="1.0" encoding="UTF-8"?>
  <referenceContainer name="top">
<block class="Magento\Framework\View\Element\Template" name="pulsestorm_nofrills_chapter2_block1" template="Pulsestorm_Nofrillslayout :: chapter2/block1.phtml">
</block>
 </referenceContainer>

file locations is

app
  code
     namespace
         modulename
              sample-xml
                -top-container.xml
                -block.xml

Please suggest me


texts: Magento 2.3.4: Test Credit card was declined on the checkout page on the staging site?

texts: Like never before, placing a test order with the dummy credit card(4111111111111111) returns an error this card was declined on the checkout page. I have had tested in the past several orders with the same CC number. Is there any setting in Magento Admin that needs to be looked into for this situation?


texts: I want to rewrite Magento-review layout catalog_product_view.xml to show Recaptcha on a product review. How can I achieve this?


texts: How to hit 3rd party API when user click on Add to cart in Magento 2?

texts:
I want to hit a 3rd party API when user click on Add to cart in Magento 2 and based on that result i want to add product on cart or show a custom message to user that didn't want to add that product on cart.
How to hit a 3rd party API on add to cart Button click in Magento 2.