texts:
I'm using Porto theme by Smartwave on Magento 2.2.5 CE. The store is based in the UK. A lot of the terms on Magento 2 are US, so I am just wondering where can I change the particular term TAX to VAT throughout the entire store?

Looking in this directory:

app/design/frontend/Smartwave/porto/i18n

I have found en_US.csv, however no en_GB.csv...even when looking in the static content directory: /pub/static/frontend/Smartwave/porto/en_GB/i18n

It shows only en_US.csv


texts: Magento 1 - how to check if product page is opened from search page results?

texts:
I've working on analytics.
I am having some difficulty to have an idea
if product is opened from search page or not.
How can i determine it ?

Thoughts are appreciated.


texts: Get config value for specific store from admin area

texts:
I'm building a custom module for both Magento 1.9.x and 2.x. In the module's settings I want to get one of the config value i.e. I have a text field and when the user save the settings, I use the string put in this text area, saved in the database, to fill a select box and do other things in my module's settings.

My question is how can I access this value if I have a multistore? I'm able to access only the value of default config.

I think I need to get the scope id and use it to access the value but I don't know how to get it within the settings.

Update 1:

I don't know how can I get the store id from admin (in particular in configuration settings area). How can I get it?

I'll explain better my problem.
In my system.xml I have some fields that have a frontend model that I wrote (like a checkbox and a select box). In the frontend model, I need to get a value of the configuration itself. It's an api key (I can get it only after the user saves the settings). This api key can be different for each store, so in the frontend model I should get the value of the specific store, but I don't know how can I get the store id.

Update 2 (Solution in Magento 1.9.x)

I found the solution for Magento 1.9.x in this question:
How to get current store id from current scope in admin. This is the function that returns the store_id

public function getStoreId()
{
   if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) // store level
   {
      $store_id = Mage::getModel('core/store')->load($code)->getId();
   }
   elseif (strlen($code = Mage::getSingleton('adminhtml/config_data')->getWebsite())) // website level
   {
      $website_id = Mage::getModel('core/website')->load($code)->getId();
      $store_id = Mage::app()->getWebsite($website_id)->getDefaultStore()->getId();
   }
   else // default level
   {
      $store_id = 0;
   }
   return $store_id;
}

And this is the code for get the config value

Mage::getStoreConfig('sectionName/groupName/fieldName', $this->getStoreId());

I'm searching the solution for Magento 2.x

Update 3 (Solution in Magento 2.x)

I solved my problem also in Magento 2.x. I use this to get the storeId:

$storeId = (int) $this->getRequest()->getParam('store', 0);

It works only in my frontend model because it extends \Magento\Config\Block\System\Config\Form\Field.

In the helper I have the function:

public function getConfig($configPath, $storeId = null)
{
   return $this->scopeConfig->getValue($configPath, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
}

When I am in the frontend model I obtain $storeId and I use:

$this->helper->getConfig('sectionName/groupName/fieldName', $storeId);

When I am anywhere I use:

$this->helper->getConfig('sectionName/groupName/fieldName');


texts: Send order email gives internal server error and place order redirects to cart preview

texts: I am new to magento. When I place an order the page redirects to shopping cart and when I try to send order confirmation email it says internal server error.


texts: How to override the existing module block files in magento2

texts:
How to extend the block file functionality?

Because the search popular terms page shows as empty, so I have extended the block file as the following. But it is not working.

/app/code/Talk/CustomSearch/registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'CustomSearch',
    __DIR__
);

/app/code/Talk/CustomSearch/etc/module.xml

<?xml version="1.0"?>

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

/app/code/Talk/CustomSearch/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\Search\Block\Term" type="Talk\CustomSearch\Block\Term" />
    </config>

/app/code/Talk/CustomSearch/Block/Term.php

<?php

/**
 * Search term block
 */
namespace Talk\CustomSearch\Block;

class Term extends \Magento\Search\Block\Term
{

    /**
     * Load terms and try to sort it by names
     *
     * @return $this
     */
    protected function _loadTerms()
    {
        exit('LoadTerms');
    }
}

The function _loadTerms() is not called. How to extend the block in the magento-search module?


texts: How to change attributes of a magento admin form field label

texts: I want to change the css class of a admin field's label. As I have found out there is not setter method such as setLabelHtml, I am not able to change the class. At last I override the Varien_Data_Form_Element_Abstract class as suggested by 'AlanStorm' in this post. I changed the 'getLabelHtml' and place the class attribute there and it worked. Is there any other better way to do it ?


texts: I need to optimise my site and  to do so I need to async call prototype. Does anybody know in which part of Magento the prototype start been called.


texts: Default checkbox in ui_component admin customer_form to true and checked?

texts:
https://devdocs.magento.com/guides/v2.3/ui_comp_guide/components/ui-checkbox.html

devdocs says default value is false but there is no clue how to turn it to true.
Anyone know what to add in xml file to make it happen. Many thanks


texts: Design Configuration page infinite loading

texts:
Since updating to Magento 2.1.0 I have not been able to change themes as the theme configuration page does not load.
It simply shows the rotating loading icon, there are no errors shown in the console and everything else works in the theme configuration section.

Has anyone had this issue and if so how was it resolved? Or anyone got any ideas on what it might be and how to fix it?


texts: How to upgrade magento to 2.1.0-rc1 via composer?

texts:
I need to upgrade version of my magento base inside store.
All the vendors I'm getting via composer and git contains only my /app/code and /web/composer.json.
Current version is 2.0.7 and needed version is 2.1.0-rc1.
What can I change inside composer.json to get this version?


texts: How to set up X day delivery shipping in magento?

texts:
I need to set up the following ..

"5 day delivery" $350/product in order
"7 day delivery" Free
"Courtesy 15 day delivery" Free

How to do this in Magento?


texts:
This is regarding updation for disable the product or any other attribute changes in bulk through Magmi has not been updated in the frontend.

Please help me out to get resolved in the same timing once CSV run through magmi.


texts: Product reviews to display even if zero reviews

texts:
In magento 1.9.3.1 on the category list page and also on the actual product view page, it displays the stars and 1 Review(s) : add your review

now this only shows up if there are reviews, anyone know how i can get this to display even if there are no reviews i.e.

the grey stars then 0 review(s) : add your review

as i want to remove the tabs with the reviews at the bottom

there are two of those statements, and i have tried changed one at a time and even both and it doesnt work for me

  <?php if ($this->getReviewsCount()): ?>

        <?php if ($this->getRatingSummary()):?>

                <div class="rating" style="width:<?php echo $this->getRatingSummary() ?>%">

        <?php endif;?>

            <a href="<?php echo $this->getReviewsUrl() ?>"><?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?>
            |
            <a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Add Your Review') ?>

<?php elseif ($this->getDisplayIfEmpty()): ?>

<a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Be the first to review this product') ?>

<?php endif; ?>


texts: Magento 1.9: How to fix Amazon Extension with Allowed JavaScript Origins issue?

texts:
Error Summary
400 Bad Request
The domain on which you are using the JavaScript SDK has not been whitelisted for your application. Please add your website domain in the 'Allowed JavaScript Origins' section under 'Web Settings' on the Amazon Seller Central App Console for Login with Amazon.

I have added my website url to the Allowed JavaScript Origins but it says it is not yet allowed. so who has any solution that can help me? Thanks very much!


texts: Display old price in dynamic bundle product price

texts:
Wanting to show the old price ('was' with strikethrough) in the main bundle product dynamic price.

Struggling to figure out how to do this though.

It is specifically the price in bundle/catalog/product/view/price.phtml.

Seems to load the price via the javascript .reloadPrice and I haven't a clue how to modify this (if that is what I even have to do) to include the old price...

Is this doable?

The reason for wanting to do this is to show the price discount when the product is on special offer.

I have tried looking into this but this modifies a different price template that isn't being used in my case and it doesn't work in the template I'm using.


texts: Set Limit for Dynamic rows UI Component in magento 2

texts:
I have used Dynamic rows in product edit form.
Here is my DataProvider class code
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
use Magento\Framework\Stdlib\ArrayManager;
use Magento\Ui\Component\DynamicRows;
class Attachments extends AbstractModifier
{
  private $arrayManager;
  public function __construct(
   ) {
     $this->arrayManager = $arrayManager;
   }

   $dynamicRows['arguments']['data']['config'] = [
        'addButtonLabel' => __('Add Row'),
        'componentType' => DynamicRows::NAME,
        'itemTemplate' => 'record',
        'renderDefaultRecord' => false,
        'columnsHeader' => true,
        'additionalClasses' => 'admin__field-wide',
        'dataScope' => 'downloadable',
        'deleteProperty'=> 'is_delete',
        'deleteValue' => '1',
        'currentPage' => 1,
        'pageSize' => 10
    ];

    return $this->arrayManager->set('children/record', $dynamicRows, $this->getRecord());
  }

In the above code 'pageSize' is limiting the rows for one page, is there any way where we can set the limit to 10?
I am just looking for the code maximum we have to show only 10 rows, can we show any error message if it crosses 10?
Please someone guide me on this. Thank you!!


texts: How to override module-sales name.phtml at all places in admin Magento 2

texts: I have followed How to override vendor/magento/module-sales/view/adminhtml/templates/items/column/name.phtml Magento 2 but, it's not change name in new shipment and view shipment section in admin.


texts: Magento 2 checkout - Update shipping methods after change of city, address line and telephone fields

texts:
I need to trigger the call that updates the shipping methods on the checkout page when the city, address lines, telephone and email fields change. Just like when the shipping methods are updated when the postcode, country and province fields change.

I have tried following the steps in this tutorial form the official docs (https://devdocs.magento.com/guides/v2.3/howdoi/checkout/checkout_carrier.html), but it seems this only validates the fields client-side and does not trigger the shipping methods update call?


texts:
Can I load my module before other modules, I want to load my module before module-page-catch how do I do that?

Without changing app/code/etc/config.php?


texts: How to add a custom block in sales order page frontend in magento 2


texts: How can i get all categories Id selected by Root Category

texts: I have three root category, i need all categories id for only selected root categories how can i get it. what are all the possible way to get it?


texts: Auto fill meta description on product pages causing duplicates

texts:
I have recently discovered via google webmaster tools that I have over 900 duplicate meta descriptions. After some digging around, I found out that when you leave a meta description blank, Magento fills it with the product description.

In most cases this probably makes sense to do. However, in my store, I have a huge selection of a type of product that is almost exactly the same except for maybe a color or a slightly modified wording. Because of this I intentionally left the meta descriptions blank since it is simply not an option to write unique meta desc tags for all these products.

So with magento auto filling these with the product descriptions which are duplicate, it is causing a big problem. Is there a way to stop magento from auto-filling. If not, the next best option would be to remove the meta description tag altogether on product pages only.

Any ideas?


texts:
I'm trying to set up multiple sites for my company.

We want to make it scaleable, so I don't want to touch the default store. I want to create 3 stores, and each one of them needs to have it's own unrelated URL.

Meaning:

http://brand-name-1.com
http://brand-name-2.com
http://brand-name-3.com

What should I use for the default URL? Do I need to buy another url (http://brand-name-0.com) and use that?

I don't want any of the brands to have any relationship on the frontend.

Thanks


texts:
how to add order qty in mini cart .

This page


texts:
I am trying to install a module which i created in magento 2 via composer,
I have hosted the module on the bitbucket repository, and added the repository url in magento's composer.json,
When i try to install the module using the following

composer require package/module

The prompt asks for username and password for

repo.magento.com

I know that this is not the repository from which i need to download the module, but to proceed further i need to provide the username and password which i suppose are the same we use to login for https://www.magentocommerce.com/magento-connect/

But somehow it gives the following error

E:\wamp\www\m2final>composer require package/module
You are running composer with xdebug enabled. This has a major impact on runtime
 performance. See https://getcomposer.org/xdebug
    Authentication required (repo.magento.com):
      Username: email@example.com
      Password:
  [Composer\Downloader\TransportException]
  Invalid credentials for 'https://repo.magento.com/packages.json', aborting.

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update]
[--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-
packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packag
es>]...`

-----EDIT-----
After Clearing the above problems, i ran into another trouble, this has to do something with my repository structure,

I have created the repository names Magento Repository, and added the repository url in magento's composer.json

when i run the command composer require package/module i get the following error

  [InvalidArgumentException]
  Could not find package package/module at any version for your minimum-stability
   (alpha). Check the package spelling or your minimum-stability

This is my module's directory structure in bitbucket

The folders in are directly created in the repository root

This is my Module's composer.json

{
  "name": "package/module",
  "description": "A Magento 2 module that creates a new page",
  "type": "magento2-module",
  "version": "1.0.0",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "extra":{
      "map":[
        [
          "*",
          "Package/Module"
        ]
      ]
    },
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/framework": "~1.0.0"
  },
  "autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Package\\Module\\": ""
    }
  }
}


texts:
In the application we are implementing a search function using rest
api. The search will happen using multiple filters. By default,
magento is using "and" operator between filters for producing search
results.

However our requirement is to use "or" operator between filter so that
result matching with any of the filter will show up.

We have one more requirement where we need to display the result
matching with first filter on top and then the result matching with
second filter

kindly guide us how we can achieve this.


texts: Multiple Attribute Sets on Configurable Products

texts:
I have a Magento store with almost 2000 simple products.

I need to feed in a selection of configurable products to eBay using M2E Pro.

To do this, I'm condensing my main categories into single configurable products (to be visible on eBay only), where via dropdowns you would first select the product type then size.

Everything was going fine until I discovered that some of the simple products have been created using different attribute sets to each other, and Magento's configurable products set up doesn't allow more than 1 attribute set to be used when creating a product.

In essence I'm trying to create configurable products that use 2 attribute sets. Is this possible without having to install a plugin to change all of the attribute sets to use the same set? That just seems dangerous and messy.

I hope that makes sense, it's hard to explain!


texts:
I am using ajax based add to cart sample product on the cart page when code reaches on save function URL redirected to 302 and the response never returned back to Ajax.
$this->cart->addProduct($product, $params);
$this->cart->save()

controller code
  <?php

    class Samplecart extends \Magento\Framework\App\Action\Action
    {

        public function __construct(
            \Magento\Framework\App\Action\Context $context,
\Magento\Framework\Data\Form\FormKey $formKey,
            \Magento\Store\Model\StoreManagerInterface $storeManager,
            \Magento\Integration\Model\Oauth\TokenFactory $tokenModelFactory
           \Magento\Catalog\Model\Product $product
           \Magento\Checkout\Model\Cart $cart,
           \Magento\Framework\Controller\Result\JsonFactory $resultPageFactory
        ) {
            parent::__construct($context);
$this->formKey = $formKey;
            $this->storeManager = $storeManager;
            $this->_tokenModelFactory = $tokenModelFactory;
            # $this->product = $product;
            #$this->cart = $cart;
            # $this->resultPageFactory = $resultPageFactory;

        }

        /**
         * Execute view action
         *
         * @return ResultInterface
         */
        public function execute()
        {
            try{
                -------
                  $params = array(
                                    'form_key' => $this->formKey->getFormKey(),
                                    'product' => $pid,
                                    'qty'   =>1,
                                    'super_attribute' => [
                                        154 => $sizeoptid
                                    ]
                                );
                        $this->cart->addProduct($product, $params);
                        $this->cart->save();
                        #$this->cartViaApi($cus
             } catch (\Exception $e) {
                echo $e->getMessage(); die;
            }

        }

    }


texts: Magento 2 ui list component issue with enabled FPC

texts:
I use UI list component to show custom product listing on frontend on cms view page.

Here an example how I put it to layout:

        <container htmlTag="div" name="ui-listing-knockout" htmlClass="listing-ui" after="-">
            <uiComponent name="widget_product_products_list"/>
        </container>

But with enabled FPC this ui component is broken randomly, not always

here example: https://pix.toile-libre.org/upload/original/1551114564.png

I can't find the reason why this UI component broken some times with FPC. Did somebody has issue like this?


texts: Magento 2 : How to override a custom module which install via composer?

texts:
I have installed one custom module using composer as usually  that module was installed in vendor directory is there any way to override phtml file in the same module like name but on app/code

module install path  -

  vendor/vendorname/module/view/frontend/templates/product/view/addtocart.phtml

App path -

  app/code/Vendorname/Module/view/frontend/templates/product/view/addtocart.phtml

Is there is any best possible way to override that and use the custom template file that resides in the app/code with the same vendor module ? just like we override the module file in the custom theme.


texts: Magento 2: Error undefined index while upgrading M 2.2.5 > M 2.3.1

texts:
While running bin/Magento setup: upgrade command I am facing this error.

  Schema creation/updates: Notice: Undefined index: core_store in
  /data/websites/website_url/public_html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php
  on line 152

For Magento upgrade, I follow below link instructions but now facing this problem.
https://digitalstartup.co.uk/t/how-to-upgrade-from-magento-2-2-8-to-2-3-1/528

Any help will be appreciated.


texts:
I want to get total item price from order item, including it's tax and any other additional price. Currently i got total price of an order item in like this:

$qty = $_item->getQtyOrdered();
$totalPrice = $_item->getPrice() * $qty;


texts:
In Configuration/General/Content Management, Enable WYSIWYG Editor is set as "Disabled by Default". And Use Static URLs for Media Content in WYSIWYG for Catalog is set as "No".

Everywhere in the admin panel (products, categories, pages..) the WYSIWYG Editor it's not working properly.

For example, if I go to a Product edit page to set the Description, all the HTML tags appear, and under the textarea it appears the button "WYSIWYG Editor". If I click it, it appears a Pop'up with the buttons "Show / Hide Editor" and Insert Image buttons at the top, and the text contains HTML elements.

See these images:

http://postimg.org/image/4831xzinl/

http://postimg.org/image/6pmkszjzb/

EDIT

For those who don't understand what I'm talking about:
The editor worked before and now it doesn't work anymore! If I choose "Enabled by Default" / "Disabled by Default" the editor still does not apper.
I haven't changed the core files. I thought that someone might know what can be the problem, but i can see that no one is able to post an answer (excepting Marius).

FIXED

The problem was that the hosting company removed some magento core files because "they contained viruses".. :) Some js files were deleted (tiny mce and others)


texts: I want to translate "Buy" and "save" word in tier_price.phtml file. magento 2

texts:
I want to translate "Buy" and "Save" word in tier_price.phtml file.I have added the word in translation csv file but it is not working form me.

Refer screenshot

PATH :

  vendor/magento/module-configurable-product/view/base/templates/product/price/tier_price.phtml

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

?>


texts: How to to update layout when call catalog_product_get_final_price event via observer

texts:
I have try to update price area html any page Ex.(Homepage, Product Listing, Product view page, etc..) via observer i have create event observer but i have no idea hoe to update layout. i have use catalog_product_get_final_price event and i have not use another event.

Her is my code

<frontend>
    <events>
        <catalog_product_get_final_price>
          <observers>
            <Test_Priceevent>
              <type>singleton</type>
              <class>Test_Priceevent_Model_Observer</class>
              <method>callforprice</method>
            </Test_Priceevent>
          </observers>
        </catalog_product_get_final_price>
</frontend>

And Observer Code is

class Test_Priceevent_Model_Observer
{
    public function callforprice(Varien_Event_Observer $observer)
    {
       echo "Test";
    }
}

currently display "Test" near product price but i have remove price section and display my custom test in specific product not all product

So Please Help me :)


texts: Critical Reminder: Download and install Magento..... how to insure these patches installed successfully?

texts:
i got this message from Magento

"Critical Reminder: Download and install Magento security patches. Download now."

and after i installed the required patches successfully i still got that message, so my question is how i insure these patches installed successfully? and if should i remove that alert manually?


texts: How to limit product max quantity per customer?

texts: i have a problem with the configuration of the stock, im explain: I need limit the product max qty per customer, the shop need sells certain qty of products per customer, this shop have 40 customers and need distribute the general stock to each customer,  how i can do it?, i hope can help me guys! thanks for ur time! have a great day!


texts:
I'm trying to create a module which displays a CMS block with a custom route on which I can add some logic etc.

But I can't get the Module's controller to work.

The route I'm trying to create is www.example.com/wholesalers/info but when I go to that page url I get a 404 page.

I've followed this mageplaza tutorial but I can't get it to work.

I've been looking and looking but can't see what I'm missing...

Module Structure

app/code/Holy/
└── Wholesalers
    ├── composer.json
    ├── registration.php
    ├── Block
    │   └── Info.php
    ├── Controller
    │   └── Info
    │       └── Index.php
    ├── etc
    │   ├── module.xml
    │   └── routes.xml
    └── view
        └── frontend
            ├── layout
            │   └── wholesalers_info_index.xml
            └── templates
                └── wholesale-info.phtml

composer.json

{
    "name": "Holy/module-Wholesalers",
    "description": "",
    "minimum-stability": "dev",
    "require": {},
    "autoload": {
        "psr-4": {
            "Holy\\Wholesalers\\": ""
        },
        "files": [
            "registration.php"
        ]
    }
}

registration.php

<?php
/**
 * @category   Local
 * @package    Holy_Wholesalers
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Holy_Wholesalers',
    __DIR__
);

etc/module.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Holy_Wholesalers" setup_version="1.0.0"/>
</config>

etc/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="wholesalers" frontName="wholesalers">
            <module name="Holy_Wholesalers" />
        </route>
    </router>
</config>

Controller/Info/Index.php

<?php
/**
 * @category   Local
 * @package    Holy_Wholesale
 */

namespace Holy\Wholesalers\Controller\Info;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory)
    {
        $this->_pageFactory = $pageFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
        return $this->_pageFactory->create();
    }
}

view/frontend/layout/wholesalers_info_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="content">
        <block class="Holy\Wholesalers\Block\Info" name="customer_wholesale_info" template="Holy_Wholesalers::wholesale-info.phtml" />
    </referenceContainer>
</page>

view/frontend/templates/wholesale-info.phtml

Hello World

And...

My Magento instance is in developer mode and I've cleared the cache etc

php bin/magento cache:flush
php bin/magento setup:upgrade


texts: Magento: 'Use categories path for product URL’s to no' - Will the old URLs be auto redirected?

texts:
I need to give specs on a magento site to set 'Use categories path for product URL’s to no', but will magento automatically redirect the old urls?

e.g:

I want to change the URLs, so URLs such as

www.example.com/blue-widgets/blue-widget1
www.example.com/new-blue-widgets/blue-widget1

will become:

www.example.com/blue-widget1

So what I want to know is will Magento automatically redirect the old URLs with the category in, to the new URLs without?  I don't have access to the site so cant test.

Thanks


texts: integrate magento site with all popular sites

texts:
we are devoloping magento site.

so we are planning to integrate our magento sites with other popular

sites like :amazon, snapdeal, flipkart...etc.

purpose:

assume we have 10 products for name "product 1".

if customer bought our product from amazon.com , the inventory should automatically

reduce to 9 in all other sites.

using magento REST & SOAP API, how to sell our products in other sites?

please guide me about this.

thanks a lot in advance....


texts: How to check number file uploaded reach to limit in component uploader

texts:
I have created my own fileuploader base on magento component. I want to check file number when it reach to limit

define(
[
    'Magento_Ui/js/lib/validation/validator',
    'Magento_Ui/js/form/element/file-uploader',
    'ko'
],
function (
    validator,
    UpLoader,
    ko
) {
    return UpLoader.extend({
        defaults: {
            template: 'uploader/uploader',
            previewTmpl: 'uploader/preview',
            isMultipleFiles : true,
            inputName: 'image',
            uploaderConfig: {
                dataType: 'json',
                sequentialUploads: true,
                formData: {
                    'form_key': window.FORM_KEY
                }
            },
            links: {
                value: '${ $.parentName }:uploadValue'
            }
        },

        //more functions here
        Parent file have lot functions here

        /**
         * This is my constructor
         * Invokes initialize method of parent class,
         * contains initialization logic
         */
        initialize: function () {
            _.bindAll(this, 'reset');
            this._super()
                .setInitialValue()
                ._setClasses()
                .initSwitcher();

            return this;
        },

        /**
         *  Retrieve max number file allow in configuration
         */
        getMaxFileNumber: function() {
            return this.uploaderConfig.maxFileNumber;
        },
    });
});

Is there a good way to check and return alert message when user number file uploaded reach to limit


texts: Magento2: Remove Store Code URL only for default store

texts:
I am developing a Magento 2 store with two store views, one for each language(English and Italian). I turned on the "Add Store Code to Urls" option from backend, so my URLs looks like:

http://mystore.com/en (English)
http://mystore.com/it (Italian)

What I would like to do now is to remove the store code from URL for the default store view, to obtain something like this:

http://mystore.com/ (English)
http://mystore.com/it (Italian)

In Magento 1.9 there a few extensions that do this. I need to find something (or develop) for Magento 2.

Anyone has some hints?

A good example of what I am searching for is this:
https://github.com/lalitmohann/magento-hide-default-store-code


texts: How to Add URL Rewrite for a Product with system value?

texts:
I want to Add URL Rewrite for a Product with system value but when creating new URL Rewrite the option Type has been disabled. Where I can set up or how to enable this option?

See my screen below :


texts: Magento 2 How to get collection in SOAP UI?

texts:
I am trying to get all SOAP api collection in SOAP UI, The initial step is wrong, Everytime it fails when I write Initial WSDL.

  Initial WSDL:

https://127.0.0.1/magento/soap/all/?wsdl&services=catalogCategoryRepositoryV1

I tried by follwing url aswell, but no luck:

http://127.0.0.1/magento/soap/all?wsdl_list=1
http://127.0.0.1/magento/soap/all?wsdl&services=integrationAdminTokenServiceV1

Initially my requirement is, I wanted category collection and then all products of any particular category.

  Please provide some solution on this,

I have Authentication key, and Content-type which we used to get collection in REST API via POSTMAN, but this time I am using SOAPUI for running SOAP API


texts: Importing product page titles and descriptions with csv into magento

texts:
Is there a way to import via a csv, product page titles and descriptions? we need to update this meta info for thousands of products and the developer says it cannot be done but we have to do manually.

obviously that will take alot of time.

does anyone know how to do this or know of a plug in that is reliable?

i found something for importing categories information: http://www.magentocommerce.com/magento-connect/bulk-category-import-export.html

thank you


texts:
I need to extend Mage_CatalogSearch_Block_Result, but something i did wrong.. can someone please help me?

community/Folder/MyName/Block/Result.php

<?php
class Folder_MyName_Block_Result extends Mage_CatalogSearch_Block_Result
{  .... }
?>

I think that the problem is here:
community/Folder/MyName/etc/config.xml

<global>
    <blocks>
        <myname>
            <class>Folder_MyName_Block</class>
        </myname>
        <catalog>
            <rewrite>
                <catalogsearch>Folder_MyName_Block_Result</catalogsearch>
            </rewrite>
        </catalog>
    </blocks>
</global>


texts:
Hi I'm using below code to fetch associated product list

$associated_products = $_product->loadByAttribute('sku', $_product->getSku())->getTypeInstance()->getUsedProducts();

Is there any way to pass entity_id and fetch product belongs to that particular entity_id ?


texts: How can i get the "Catalog Input Type for Store Owner" value

texts: I want to get the value as Visual Swatch which is selected by the admin. This value color is a custom attribute but i want to know how it looks. How can i fetch this value.


texts: How to remove Tier Price programatically in Magento 1.9?

texts:
I want to update tier price for a simple and configurable product. I have only one type of tier price with

Customer Group - Wholesale,
Qty - 1,
Price -10

Now I want to update tier price and for that first, I need to delete tier price of the product.

Can anyone help me in updating and deleting of tier price programmatically in Magento?


texts: How to get completed sales with rest API in magento 2?

texts:
Github issue: https://github.com/magento/magento2/issues/1578

It works for processing status, however I get an error for completed or closed

curl -X GET -H "Authorization: Bearer ufkm720fkvqix2v0dhhs8xvpp3g4lmcc" -H "Cache-Control: no-cache" -H "Postman-Token: 366814d0-e058-7b89-c896-5670fb4fadb9" 'http://magento2.app/index.php/rest/V1/orders?criteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=status&criteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=processing'

result: {"items":[]}

curl -X GET -H "Authorization: Bearer ufkm720fkvqix2v0dhhs8xvpp3g4lmcc" -H "Cache-Control: no-cache" -H "Postman-Token: 366814d0-e058-7b89-c896-5670fb4fadb9" 'http://magento2.app/index.php/rest/V1/orders?criteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=status&criteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=closed'
{"message":"Internal Error. Details are available in Magento log file. Report ID: webapi-55b7959277fcb"}

The log is as following:

[2015-07-28 14:45:38] main.CRITICAL: exception 'Exception' with message 'Report ID: webapi-55b7959277fcb;
Message: Notice: Array to string conversion in /home/vagrant/laravel-root/magento2/lib/internal/Magento/Framework/Reflection/TypeCaster.php on line 34' in /home/vagrant/laravel-root/magento2/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php:194
Stack trace:
#0 /home/vagrant/laravel-root/magento2/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(Exception))
#1 /home/vagrant/laravel-root/magento2/app/code/Magento/Webapi/Controller/Rest.php(191): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(Exception))
#2 /home/vagrant/laravel-root/magento2/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#3 /home/vagrant/laravel-root/magento2/lib/internal/Magento/Framework/App/Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#4 /home/vagrant/laravel-root/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()
#5 /home/vagrant/laravel-root/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#6 {main} [] []

Can you point me in a right direction? Do you think it's a magento 2 bug?

Thank you

Magento 2 Rest API: http://devdocs.magento.com/guides/v2.0/rest/restApi/restCollection/Magento/Sales/Service/V1/OrderList/orderList.html

Token-based authentication: http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html


texts: Spaces must be used to indent lines; tabs are not allowed Magento 2

texts:
I am checking coding standards of my module. I face this warning in technical report

  Spaces must be used to indent lines; tabs are not allowed

public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory
) {
    $this->resultForwardFactory = $resultForwardFactory;
    parent::__construct($context);
}

For Ex: Here is total 7 lines, I face error at line no 3 even line 2 and 3 have same spaces.

I am using sublime text editor.

How we found that we make tab or space?


texts: How to improve the php memory limit in Magento Cloud?

texts:
I've installed a Magento Cloud 2.3.5 and I don't have access to the server configuration.

How can I configure a new PHP Memory Limit?


texts: Magento 2: How to redirect customer to login page

texts:
How can I check customer is logged in or not? If customer is not logged in then how to redirect him to the login page?

I want to do this from .phtml file. So please help me as per that.


texts: Remove item from cart return to home page issue magento 1.9.2.4

texts: We're using Magento ver. 1.9.2.4 and we have an issue where a user removes an item from the cart and the cart will redirect back to the homepage instead of conventionally just returning to the checkout page (even with zero items).


texts: Magento 2: How to disable Adjustment Fee field ONLY

texts:
I want to disable only the adjustment field from the refund section

I already created a custom template called adjustments.phtml which basically it haves all the html

    <?php /* @escapeNotVerified */ echo __('Adjustment Fee') ?>

        <input type="text"
               name="creditmemo[adjustment_negative]"
               value="<?php /* @escapeNotVerified */ echo $_source->getBaseAdjustmentFeeNegative()*1 ?>"
               class="input-text admin__control-text not-negative-amount"
               id="adjustment_negative"/>

I also already created my custom layout called saled_order_creditmemo_new.xml in which i placed the remove block code

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <referenceBlock name="creditmemo_totals">
        <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Adjustments" name="adjustments" template="order/creditmemo/create/totals/adjustments.phtml"/>
        <referenceBlock name="adjustments" remove="true"/>
    </referenceBlock>

The thing is it does disable three fields the ones that editable in the picture below

How can I only disable the one i want?


texts:
magento 2 extra fee not adding to grandtotal in invoice

block is calling but model is not calling

<?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="invoice_totals">
        <block class="Custom\LoyaltyProgram\Block\Adminhtml\Sales\Order\Invoice\Fee" name="fee"/>
    </referenceContainer>
</body>

Block

<?php
 namespace Custom\LoyaltyProgram\Block\Adminhtml\Sales\Order\Invoice;

class Fee extends \Magento\Framework\View\Element\Template
{
protected $_config;
protected $_order;
protected $_source;

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Tax\Model\Config $taxConfig,
    \Custom\LoyaltyProgram\Helper\Data $helper,
    \Custom\LoyaltyProgram\Model\Extrafee $extraFeeModel,
    array $data = []
) {
    $this->_config = $taxConfig;
    $this->_helper = $helper;
    $this->extraFeeModel = $extraFeeModel;
    parent::__construct($context, $data);
}

public function displayFullSummary()
{
    return true;
}

public function getSource()
{
    return $this->_source;
}
public function getStore()
{
    return $this->_order->getStore();
}
public function getOrder()
{
    return $this->_order;
}
public function getLabelProperties()
{
    return $this->getParentBlock()->getLabelProperties();
}

public function getValueProperties()
{
    return $this->getParentBlock()->getValueProperties();
}
public function getInvoice()
{
    return $this->getParentBlock()->getInvoice();
}
 public function initTotals()
{
    $this->getParentBlock();
    $this->getInvoice();
    $this->getSource();

    $parent = $this->getParentBlock();
    $this->_order = $parent->getOrder();
    $this->_source = $parent->getSource();

    $orderId = $this->_order->getId();
    $store = $this->getStore();

    $collection = $this->extraFeeModel->getCollection();
    $collection->addFieldToFilter('order_id', $orderId);

    if($collection->getSize()){

        $extraFee = $collection->getFirstItem()->getFee();
        $extraFee = -1*$extraFee;

        $fee = new \Magento\Framework\DataObject(
                [
                    'code' => 'fee',
                    'strong' => false,
                    'value' => $extraFee,
                    'label' => $this->_helper->getTitle()
                ]
            );
        $parent->addTotal($fee, 'fee');
    }

    $this->getInvoice()->setGrandTotal($this->getInvoice()->getGrandTotal() - $extraFee); // "2" extra fee
    $logger->info('2getGrandTotalblock'.$this->getInvoice()->getGrandTotal());

    $this->getParentBlock()->addTotalBefore($fee, 'grand_total');
    return $this;

}}

Model

<?php

namespace Ewall\LoyaltyProgram\Model\Invoice\Total;

use Magento\Sales\Model\Order\Invoice\Total\AbstractTotal;

class Fee extends AbstractTotal
{
/**
 * @param \Magento\Sales\Model\Order\Invoice $invoice
 * @return $this
 */
public function collect(\Magento\Sales\Model\Order\Invoice $invoice)
{

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/fee.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('model calling:');

    $invoice->setFee(0);

    $amount = $invoice->getOrder()->getFee();
    $invoice->setFee($amount);

    $invoice->setGrandTotal($invoice->getGrandTotal() - 2); // 2 extra fee
    $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() - 2);  // 2 extra fee

    return $this;
}}


texts: How to redirect to customer login with JS

texts:
I found this answer, which shows how to redirect to the admin login with JS:

window.location='<?php echo Mage::getBaseUrl().(string)Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName')?>';

How could I redirect to customer login using JS?


texts:
This is the default vendor/magento/module-checkout/view/frontend/layout/checkout_onepage_success.xml
This layout defines between other things :
<block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="Magento_Checkout::success.phtml" cacheable="false">
    <container name="order.success.additional.info" label="Order Success Additional Info"/>
</block>

What I would like to do is add a piece of script like a simple:
<script>
    console.log('script added');
</script>

To the success.phtml template file.
What is the best way to do it ?
Notice that I already have a custom design/frontend/folder/Magento_Checkout/templates but success isn't in here. I guess I can add a custom success.phtml in this location, but I probably need to specify the new file somewhere ?


texts: Magento 2.1.6 to 2.1.7 Upgrade Issues Or Latest version

texts:
I am using following commands Magento upgrade 2.1.6 to 2.1.7 and also 2.1.9

I am getting error below command run via putty,

  composer require magento/product-community-edition 2.1.7 composer
  update

./composer.json has been updated
 Loading composer repositories with package information
 Updating dependencies (including require-dev)
 Your requirements could not be resolved to an installable set of packages.

**Problem 1**
- Conclusion: don't install magento/product-community-edition 2.1.7
- Conclusion: remove magento/framework 100.1.6
- Conclusion: don't install magento/framework 100.1.6
- Installation request for magento/product-community-edition 2.1.7 ->
 satisfiable by magento/product-community-edition[2.1.7].
 - Conclusion: don't install magento/framework 100.1.6
 - magento/product-community-edition 2.1.7 requires magento/framework
 100.1.7 -> satisfiable by magento/framework[100.1.7].
 - Can only install one of: magento/framework[100.1.6, 100.1.7].
 - Can only install one of: magento/framework[100.1.6, 100.1.7].
 - Installation request for magento/framework (locked at 100.1.6) ->
 satisfiable by magento/framework[100.1.6].

Installation failed, reverting ./composer.json to its original content.

How to upgrade magento 2.1.6 to magento 2.1.9 or latest version

Please help me asap .


texts: Magento2 admin custom module throwing the error

texts:
I created a custom module in magento2 for admin panel. Grid form is version fine. But When I tried to add/edit a record then its throwing the error like "Changes have been made to this section that have not been saved. This tab contains invalid data. Please resolve this before saving."

Magento version is 2.1.1.

I am unable to find any clue in logs.

System.log file has follow error.

  [2017-03-20 09:16:25] main.CRITICAL: Broken reference: the 'header'
  tries to reorder itself towards 'global.notices', but their parents
  are different: 'page.wrapper' and 'notices.wrapper' respectively. []
  []

  [2017-03-20 09:16:25] main.CRITICAL: Broken reference: the
  'page.breadcrumbs' tries to reorder itself towards 'notifications',
  but their parents are different: 'page.wrapper' and 'notices.wrapper'
  respectively. [] []

  [2017-03-20 09:16:25] main.CRITICAL: Broken reference: the
  'global.search' tries to reorder itself towards
  'notification.messages', but their parents are different:
  'header.inner.right' and 'header' respectively. [] []

  [2017-03-20 09:16:30] main.INFO: Cache file with merged layout:
  LAYOUT_adminhtml_STORE1_3d41d8cd98f00b204e9800998ecf8427e and handles
  : Please correct the XML data and try again.  [] []

  [2017-03-20 09:16:33] main.CRITICAL: Broken reference: the 'header'
  tries to reorder itself towards 'global.notices', but their parents
  are different: 'page.wrapper' and 'notices.wrapper' respectively. []
  []

  [2017-03-20 09:16:33] main.CRITICAL: Broken reference: the
  'page.breadcrumbs' tries to reorder itself towards 'notifications',
  but their parents are different: 'page.wrapper' and 'notices.wrapper'
  respectively. [] []

  [2017-03-20 09:16:33] main.CRITICAL: Broken reference: the
  'global.search' tries to reorder itself towards
  'notification.messages', but their parents are different:
  'header.inner.right' and 'header' respectively. [] []

Content of Namespace_Module_redirectdata_edit.xml file is:

<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<update handle="editor"/>
<body>
    <referenceContainer name="content">
        <block class="Techies\Customredirect\Block\Adminhtml\Redirectdata\Edit" name="techies_customredirect_redirectdata_edit"/>
    </referenceContainer>
    <referenceContainer name="left">
        <block class="Techies\Customredirect\Block\Adminhtml\Redirectdata\Edit\Tabs" name="techies_customredirect_redirectdata_tabs">
            <block class="Techies\Customredirect\Block\Adminhtml\Redirectdata\Edit\Tab\Redirectdata" name="techies_customredirect_redirectdata_edit_tab_redirectdata"/>
            <action method="addTab">
                <argument name="name" xsi:type="string">redirectdata</argument>
                <argument name="block" xsi:type="string">techies_customredirect_redirectdata_edit_tab_redirectdata</argument>
            </action>
        </block>
    </referenceContainer>
</body>

Error thrown in browser is:


texts:
I am using Magento 2.1 and I want to display download link in my Contact us page.

If I click in this link then I want to display PDF file.


texts: I need to add icons before each categories in my main menu. Is there any extensions for that or can u provide the details to edit which of the files in magento


texts: How to use third party extension search algorithm in my module? magento 2.1.5

texts:
I have a third party extension installed on my website. The extension has a powerful search engine. I have created a mobile app which gets data from magento2 REST APi. However the default magento search algorithm is bad. I want to create a
new module which does the following:

Accepts search keyword sent from mobile app.
Sends the search keyword to the third party extension or use its algorithm to search the data.
Return a result.

I know how to create a magento module which extends Api. But I can't find a way to use the third party app in my module.


texts: How to get value from additional column in the quote_item table to show it on the checkout page?

texts:
So what I have done so far is adding new value to the quote_item table using an observer. the column name is expected_delivery_time.

Now the column expected_delivery_time will be populated for the product which added to the cart.

I see the column expected_delivery_time is exist and has the value whenever I see the page source.

Now I would like to show this column value in the checkout page to the users on each selected product.

How do I achieve this ?

For some reason simple thing is not easy in magento 2.


texts: Could you help me to add the "Base Unit of Measure" after the price, like this "$2.35 / YDS".


texts: Apache Virtual host setup configuration in localhost for multiple magento sites

texts:
I have two Magento 2 instances in my Virtualbox ubuntu server.
1st one is new installation magento2.3 located at
/var/www/html/, it is working fine and accessible from the browser using IP 127.0.0.1 or localhost

The 2nd instance is a cloned version of production site Magento 2.2.9, located at /var/www/html2/. I'm able to run bin/magento commands from the command line, however, I'm not able to access the site from the browser.

How do I modify the configuration file for hosts at  /etc/apache2/sites-available/ to work with multiple Magento sites?

  /etc/apache2/sites-available/newsite.conf

<VirtualHost *:80>
            ServerAdmin webmaster@admin.com
            ServerName localhost
            DocumentRoot /var/www/html
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

  /etc/apache2/sites-available/newsite2.conf

<VirtualHost *:80>
        ServerAdmin webmaster@admin.com
        ServerName localhost2
        DocumentRoot /var/www/html2

        <Directory /var/www/html2>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

  /etc/hosts

127.0.0.1 localhost
127.0.0.1 localhost2


texts:
I'm completely new to magento and i've read some threads in this forum but i'm not quite sure whether my solution is correct.

I have a product which can change its price depending on the customers choice. for example customer can choose how many square meters of the product he wants to buy. Depending on that choice the price has to be recalculated and should be displayed immediately.

This is done via ajax call to my customized controller which overrides the "Mage_Core_Controller_Front_Action"

Second, i have registered an observer for the "catalog_product_get_final_price" event. This observer overrides the final price in the product with my own calculated final price.

My questions now are:

Is this the best possible solution for this problem?
Are there any problems with this solution? Did i miss something very important?
What do i have to test?


texts: Redirect "Add to Cart" from Category page to CMS page

texts:
On my category page, if the user clicks "Add to Cart", then I want to add that product to their cart and then redirect to a CMS page.

I've seen the other solutions available, but none of them seem to address the situation from the category view - only from the product page itself.

Currently, the Add to Cart button uses onclick="setLocation('<?php echo $addCartUrl; ?>')" where $addCartUrl = $this->getAddToCartUrl($_product);

This addCartUrl redirects automatically to /checkout/cart.

How can I redefine the redirect for category pages only?


texts:
I'm having a problem with magento ajax cart. When I add or remove a product in the cart, the product is added and also excluded. However it does not appear when I add and does not add when I delete and only with reload of the page. There is no error in console,log and everything is okay.

It returns successfully message but it does not display the product in the cart, nor does it exclude when it is the case, only when I reload the page

link->
www.maressamoda.com.br

When remove.

{message: "Item was removed.", r: "success"}
message
:
"Item was removed."
r
:
"success"

When I add

{product_name: "Camiseta Fitness Don't Stop At Good Ref: 10094",…}
message
:
"Camiseta Fitness Don't Stop At Good Ref: 10094 was added into cart."
product_name
:
"Camiseta Fitness Don't Stop At Good Ref: 10094"
r
:
"success"


texts: How can I get a list of items being returned using the POST /rest/default/V1/returns endpoint?

texts:
I am trying to get access to items that are being returned by customers. I am trying to access this information using the Magento /returns endpoint. The problem is that when I access this endpoint I see an attribute called "items" but it is returning None
When I look at the return via UI I can see 2 sections:
The first section contains customer return information.
The second section contains items that the customer is requesting to return.
This is what I see in the Magento Admin UI:

However, when I try to look at the return data for the same return using the Magento returns/ API this is what I see:
Endpoint: "https://www.magento-store.com/rest/default/V1/returns/000001502"
{'increment_id': '000001502',
 'entity_id': 1502,
 'order_id': 710239,
 'order_increment_id': '1000535018',
 'store_id': 1,
 'customer_id': 163109,
 'date_requested': '2020-06-24 17:17:32',
 'customer_custom_email': None,
 'items': None,
 'status': 'pending',
 'comments': None,
 'tracks': None}

I was thinking that a list of items being returned would be found in the 'items' attribute but as you can see it is showing up as None.
At first I thought it may be an issue with the way permissions are setup but I enabled all permissions just to test and I got the same result.


texts: Magento 2: Add button next to "Shopping Cart" title

texts:
When viewing my shopping cart there is an header "Shopping Cart", looks like this:

How can I add an button (or just a "a href link which has div inside it" would also be good enough) in that header part?

For example I would like to get "Continue shopping" which redirects to homepage when pressed.

In the end I want something like this:

Thank you very much!


texts: Remove index.php from admin url on live server?

texts:
I  am trying to resolve this problem form 2 day ago but i cant success to resolved it

I  given all details of this problem

we have magento installed on root directory i.e public_html on live server

  .htaccess file of server is something like this,

AddHandler application/x-httpd-php52 .php5 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php52 .php .php3 .php2 .phtml

RewriteEngine on

Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  # we skip all files in /web
  RewriteCond %{REQUEST_URI} ^/zimode/
  RewriteRule .* - [L]

  # we rewrite all other files with .something to /web
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule ^(.*)$ /zimode/$1 [L]

  # !!! UNTESTED !!! ##################################
  # we check if the .html version is in /web (caching)
  #RewriteRule ^$ /zimode/index.html [QSA]
  #RewriteRule ^([^.]+)$ /zimode/$1.html [QSA]
  #####################################################

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ /zimode/[QSA,L]

</IfModule>

What i had already try to resolve it as,

  i had enabled  mod_rewrite  using admin panel.
  try to install admin url module which remove index.php from admin url.

Note:

 xyz.com/admin/

when i hit above url i see admin login panel i am login successful but got

page not found

404 error occurred....

and now url changed something like  xyz.com/index.php/admin/......

when i remove that index.php  from url it works

So any one have any idea? How to resolve it.

Waiting for your answer...  Thanks in Advance.


texts: How to get url parameter in Model/ResourceModel/agent/Grid/Collection.php

texts:
protected function _initSelect()
{
    parent::_initSelect();
    $agent_id = $this->request->getParam('agent_id');

}

Try to get "agent_id" from url but getting this eror
Type Error occurred when creating object: Magedelight\DeliveryAgent\Model\ResourceModel\DeliveryAgentShipment\Grid\Collection\Interceptor, Argument 1 passed to Magedelight\DeliveryAgent\Model\ResourceModel\DeliveryAgentShipment\Grid\Collection\Interceptor::__construct() must implement interface Magento\Framework\App\RequestInterface, instance of Magento\Framework\Data\Collection\EntityFactory given, called in /var/www/html/CE/241/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

construct signature
public function __construct(
  \Magento\Framework\App\Request\Http $request,
    EntityFactory $entityFactory,
    Logger $logger,
    FetchStrategy $fetchStrategy,
    EventManager $eventManager,
    $mainTable = 'magedelight_delivery_agent_shipment',
    $resourceModel = "Magedelight\DeliveryAgent\Model\ResourceModel\DeliveryAgentShipment",
    $identifierName = null,
    $connectionName = null
) {
    $this->request = $request;
    parent::__construct(
        $entityFactory,
        $logger,
        $fetchStrategy,
        $eventManager,
        $mainTable,
        $resourceModel,
        $identifierName,
        $connectionName
    );
}


texts:
How to get Magento category page title in frontend?
Already tried:

<?php if ($category->getPageTitle()):?>
    <?php echo $_helper->categoryAttribute($_category, $_category->getPageTitle(), 'page_title') ?>
<?php else: ?>


texts: Get all products of a category only - without products of its child categories

texts:
I'm trying to get all products of a certain category. Unfortunately I always get not only all products of the category but also all products from its child categories. What am I doing wrong?

For example I'm working with following code snippet:

$catId = 160;
$category = Mage::getModel('catalog/category')->load($catId);
$collection = $category->getProductCollection()->addAttributeToSort('position');
Mage::getModel('catalog/layer')->prepareProductCollection($collection);

foreach ($collection as $product) {
var_dump( $product->getId() );
}

Above category (ID 160) contains 17 products but I get 51 products. If I look these up I see that all these products are assigned to one of the child categories of category ID 160. Sometimes even a sub-sub-category of #160.

Ran a full reindex - didn't help. Caches are all disabled.
Magento ver. 1.9.2.0

Thank you so much in advance!


texts:
We currently run 5 or 6 different magento stores as completely separate installations, primary as a result of weird behavior and outright crashes a few years back (pre 1.4) when magento's multistore was not as robust as is now.

On to the question: It's becoming a PITA to synchronize admin users and roles between these different stores, and short of paying out for an LDAP module and trying to integrate that (I've never touched LDAP before in my life), would there be any complications to just syncing the admin_user and admin_role tables at the SQL level?

Or does anyone else happen to know a slick trick to accomplish the same goal?


texts: Magento 2: How to reduce column width in admin grid?

texts:
I want to change column width. I don't want any scroller due to a large column width in admin grid.

Here is the code. I am using:

<block class="Magento\Backend\Block\Widget\Grid\Column" as="api_params">
    <arguments>
        <argument name="header" xsi:type="string" translate="true">API Parameters</argument>
        <argument name="index" xsi:type="string">api_params</argument>
        <argument name="type" xsi:type="string">text</argument>
        <argument name="width" xsi:type="string">60</argument>
        <argument name="column_css_class" xsi:type="string">col-id</argument>
        <argument name="header_css_class" xsi:type="string">col-id</argument>
    </arguments>
</block>

Screenshot:


texts:
I was trying to disable all my caches, then I noticed that one of my Magento 2 installations has a particular cache type called Compiled Config.

I don't want to use my installation compiled, I wan't to disable the compilation to not see this cache option, how could I disable the compilation?


texts: Magento: how to add description at the bottom of the page

texts:
My boss wants me to do this SEO activity:
if you see this example site:

http://it.dawanda.com/borse/

and you go at the bottom of the page, you can read a formatted description of the chosen product. My boss wants me to do the same for another site, so that Google can easily index it and I am supposed to use Magento. For example, the picture below shows Magento admin page:

For each category I should add a footer block as in example site I've just linked. I don't know where to put my hands in this page. Thanks


texts: Fatal Error : Uncaught Error: Call to a member function getPdf()

texts:
I am getting the following error

Fatal error: Uncaught Error: Call to a member function getPdf() on
bool in
/var/www/html/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php:119
Stack trace: #0
/var/www/html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php(489):
Mage_Adminhtml_Controller_Sales_Invoice->printAction() #1
/var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(437):
Mage_Adminhtml_Sales_Order_InvoiceController->printAction() #2
/var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(262):
Mage_Core_Controller_Varien_Action->dispatch('print') #3
/var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(192):
Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /var/www/html/app/code/core/Mage/Core/Model/App.php(381): Mage_Core_Controller_Varien_Front->dispatch() #5
/var/www/html/app/Mage.php(729): Mage_Core_Model_App->run(Array) #6
/var/www/html/index.php(80): Mage::run('default', 'store') #7 {main}
thrown in
/var/www/html/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php
on line 119


texts: Changing text for check payment method on magento check out page

texts:
I'm new to magento so please remember when responding. What I want to do is change the text on the magento check option. I had the ability to change the title to "wire transfer" but would like to change the text that says "make check payable to" and "send check to".

Please let me know if this is possible and where I would find this file. Thank you for your help!


texts: How to add new country in country dropdown in magento2.2.1

texts:
I want to add new country and its region in magento2.2.1 so it can be shown throughout the site(including backend countried dropdown, checkout at frontend).

I have tried this link of magento1 but did not worked in M2-
http://snipplr.com/view/56229/add-new-country-to-magento/

Can anyone help me ?

EDIT--

I want to add "Channel Islands" as new country and I couldn't found its ISO2 and ISO3 code.


texts:
I want to activate the gift card div on shopping cart page. How can I do that on admin configuration? Also I can't remember if I comment it out so I want to ask also what is the path to check the gift card template?

I'm using Magento Enterprise version 1.14

Thanks


texts: Can i delete images left in media/import/ folder

texts:
Once i have imported my product images from the media/import folder in magento - is it safe to delete them from that folder?

I want to delete them to save disk space but want to make sure deleting them won't suddenly mean missing product images throughout my catalogue?


texts: Magento 2 model error after updating on 2.2 verison

texts:
I have a CRUD module created on magento 2.1.6 version which was working ok untill i updated magento to version 2.2.1

Now when i compile my code i receive the following err:

namespace\module\Model\ResourceModel\Post\Grid\Collection
Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \namespace\module\Model\ResourceModel\Post\Grid\connection; File:
/data/web/public/app/code/namespace/module/Model/ResourceModel/Post/Grid/Collection.php

so my constructor looks like this before i made any changes:

 public function __construct(
        \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        $mainTable,
        $eventPrefix,
        $eventObject,
        $resourceModel,
        $model = 'Magento\Framework\View\Element\UiComponent\DataProvider\Document',
        $connection = null,
        \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
    )
    {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
        $this->_eventPrefix = $eventPrefix;
        $this->_eventObject = $eventObject;
        $this->_init($model, $resourceModel);
        $this->setMainTable($mainTable);
    }

after i changed the constructor according to the compile error my constructor looks like this:

public function __construct(
        \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        \Magento\Framework\DB\Adapter\AdapterInterface  $connection = null,
        $mainTable,
        $eventPrefix,
        $eventObject,
        $resourceModel,
        $model = 'Magento\Framework\View\Element\UiComponent\DataProvider\Document',

        \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
    )
    {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
        $this->_eventPrefix = $eventPrefix;
        $this->_eventObject = $eventObject;
        $this->_init($model, $resourceModel);
        $this->setMainTable($mainTable);
    }

Now when i compile the code i don't have any err, but when i tried to access my "module menu" i receive this err:

PHP message: PHP Fatal error:  Method Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an exception, caught Error: Cannot instantiate interface Magento\Framework\DB\Adapter\AdapterInterface

IT said that "Magento\Framework\DB\Adapter\AdapterInterface" can't be instantiate, even the compile was asking for this.

Does anyone have any idea how to solve this problem?


texts: How to change the Magento export order CSV layout?

texts:
I want to change the export orders CSV column layout. For example, it is showing the following column

Order #Purchased OnBill to NameShip to NameG.T. (Base)G.T. (Purchased)Status

Check my screenshot http://take.ms/d3OVH

But I want it like following

Sales Record Number
Buyer Full name
SKU
Quantity
Post To Address 1
Post To Address 2
Post To City
Post To County
Post To Postcode
Post To Country

Check my screenshot http://take.ms/jloSf

Thank you


texts:
I'm working with emarsys and i keep having issues with their webextend scripts. Data is being served to wrong customers and abandoned emails are populating the wrong items. They keep telling me it's because caching needs to be turned off on their blocks. So I've implemented this below and it should work fine but i'm still running into issues.

    <reference name="before_body_end">
        <block type="core/template" name="emarsys_webextend_script" as="emarsys_webextend_script" template="tm/emarsys/webextend.phtml">
            <action method="setCacheLifetime" /> <!-- disable caching -->
            <action method="unsetData"><key>cache_lifetime</key></action>
            <action method="unsetData"><key>cache_tags</key></action>
        </block>
    </reference>

Could this have anything to do with redis?


texts: Magento 2 : Sorry, no quotes are available for this order at this time in "ups"

texts:
I have configured ups in magento 2. When I do checkout with correct address (zipcode/country) it still give me error like this.

sorry, no quotes are available for this order at this time

Why this error comes and how to fix it?


texts: auto login to admin panel from an external file( out side magento root directory)

texts:
require_once 'mystore/app/Mage.php';
 umask(0);
 Mage::app('default');
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
$user = Mage::getModel('admin/user')->loadByUsername('admin');
if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
Mage::getSingleton('adminhtml/url')->renewSecretUrls();
}

$session = Mage::getSingleton('admin/session');
$session->setIsFirstVisit(true);
$session->setUser($user);
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());
Mage::dispatchEvent('admin_session_user_login_success',array('user'=>$user));

if ($session->isLoggedIn()) {
  echo "Logged in";
  $redirectUrl = Mage::getSingleton('adminhtml/url')->getUrl(Mage::getModel('admin/user')->getStartupPageUrl(), array('_current' => false));
  header('Location: ' . $redirectUrl);
    exit;
}

It is redirecting to the admin panel but shows the login page. Is it possible show the dashboard as the admin is already logged in?


texts:
I have a new website that is running Magento 1.7.0.2.

When you search in the search bar for say "totem" nothing pulls up, instead it says no results can be found. I know there are results, but if you search specifically by the SKU  like "tn truth-1" than a product will show up.

This was happening before I installed the search with the drop down.

Debugging Steps I have taken:

Clear Cache
Re-Index Site
Went to System > Configuration > Catalog > Catalog Search and set Search Type to Combine (Like and Fulltext)
Re-indexed Site
Cleared Cache
Installed Searchanise http://www.magentocommerce.com/magento-connect/searchanise-connector-add-on-2652.html
Check var/report - Nothing
Checked the logs and there is nothing
Went to stock theme and all plugins disabled

At this point I am not sure what else to do, I would love to give you code example, but I am afraid those won't help because there is no custom coding with the search, especially seeing that it didn't work when I put everything to stock Magento and no plugins.

If you need code or a stack trace, just let me know and I would be happy to get those to you if you tell me what files and how to make the stack trace since nothing is logging right now.


texts:
I have just finished a new Magento website which includes online credit card payments, all the processing is done during the checkout so there is no redirect to a payment gateway etc.

I have install a business Validated SSL certificate, however I still find customers are dropping off just before paying. My question is, what do you do to make your clients feel secure on the checkout page?


texts: Add to wishlist without redirect to wishlist

texts: How to disable or redirect to same page after pushing add to wishlist button? Same way you can disable it for add to cart.


texts: Magento 2 - How to use jQuery in CMS page

texts:
how to add  cms home page jquery in magento 2

jQuery(document).ready(function($){

   $(".home-banner").insertBefore(".page-main");

 });

Please advance thanks for help


texts: How to translate (__('Invoice ') . $invoice->getIncrementId())?

texts:
How to translate below string in pdf invoice  attachment from fooman extension

(__('Invoice ') . $invoice->getIncrementId())

I am not able to translate the attachment name. It is in php file. Can anybody please help to resolve this issue.


texts: How to add media query for div alignment

texts:
My design,

I need mobile view like,
first block         second block
third block         fourth block
How to include media query?
Script :

First block

test test test test

<div class="row" style="top: 1461px; left: 492px; width: 110px; height: 23px; text-align: center; font: normal normal 600 19px/22px Laca; letter-spacing: 0px; color: #0072bc; opacity: 1; margin: 0px 15px;"second block

test test test test

third block

test test test test

fourth block

test test test test


texts: How to Set admin Custom module Template file without Head and other Part in magento2

texts:
I just need to show my custom module template files on Magento 2 admin panel without any Magento 2 core JS and CSS and left menu section.
I can do the same things in Magento 1 custom module layout file using below code but the same alternate I have not found in magento2.
<reference name="root">
    <action method="setTemplate">
        <template>Scanner/Main.phtml</template>
    </action>
</reference>

I have used the admin-empty layout but still its adding core JS and CSS file at head and also left menu which conflicting with my custom module JS and CSS file.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-empty" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Namespace\Scanner\Block\Adminhtml\Index\Index" name="dsscanner_index" template="Namespace_Scanner::index.phtml"/>
        </referenceContainer>
    </body>
</page>


texts: Upgrading Magento 2.2.6 and want to upgrade to Magento 2.4

texts:
I am using Magento 2.2.6 Enterprise version and the site is live now.
I want to upgrade my store to the latest version of Magento which is 2.4.1. My store has many customizations in code and theme aspects. Some of the customizations are checkout, login, sales, product, pricing, and finance-related.
Except for the order placement, product and pricing, financial management, order processing, etc are handled by different systems like the ERP and the CRM. Now, I want to know will all, or any of these customizations be affected when I upgrade to Magento 2.4.1?
Should I have to make any code changes according to Magento 2.4.1?
Please clarify my question.
Thanks in advance.


texts: Role based hide lifetime sales from dashboard

texts:
When you log into the Magento admin dashboard it shows the lifetime sales.
We want to restrict that block to only show for the admin not for the other employees.

Of course, we could just remove the dashboard from their role, but we would like them to be able to access the dashboard, we just don't want them seeing the lifetime sales.


texts:
In Magento 2.3.3, I save form data by ajax and need to display success message after save records.

  Expected Result :

Message manager should be display.

  Actual Result :

Message manager not display. It will display after page reload.

  Controller code :

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Vendor\Magento\Controller\Adminhtml\Post;

class Save extends \Magento\Backend\App\Action {

    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $resultPageFactory;

    /**
     * @var \Magento\Backend\Model\Session
     */
    protected $adminsession;

    /**
     * @param \Magento\Backend\App\Action\Context        $context           [description]
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory [description]
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Backend\Model\Session $adminsession
    ) {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
        $this->adminsession = $adminsession;
    }

    public function execute() {
        $resultRedirect = $this->resultRedirectFactory->create();
        /** Save Logic */
        try {
                $object->save();
                $this->messageManager->addSuccessMessage(__('Data has been saved.'));
                //$this->messageManager->addMessages($this->messageManager->getMessages(true));
                //$this->messageManager->setMessages($this->messageManager->getMessages(true));
                $this->adminsession->setFormData(false);
            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\RuntimeException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\Exception $e) {
                $this->messageManager->addException($e, __('Something went wrong while saving the data.'));
            }
            $this->_getSession()->setFormData($postData);
    }
}

  Note : I don't want to set message using jQuery.

Any help would be appreciated.

Thanks.


texts: Magento 1: Add Layout XML from file using Observer

texts:
In an existing observer, I would like to conditionally add a layout file to be parsed for cms_pages.  I am already able to determine that the request is for a cms_page, and I then add a unique, custom handle to it so that I can forego using the cms_page.custom_layout_xml data-field, among other reasons.  Hopefully that explains why I would want to apply it only to the pages to which it applies.  I have found a few sources like this one that pointed me in a promising direction, but adding layout is limited to the actual xml-string, rather than parsing a file.  Here is the code I have...
app/code/local/Vendor/Layout/etc/config.xml:
<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Layout>
            <version>0.1.0</version>
        </Vendor_Layout>
    </modules>
    <frontend>
        <events>
            <controller_action_layout_load_before>
                <observers>
                    <vendor_observer>
                        <class>Vendor_Layout_Model_Observer</class>
                        <method>controllerActionLayoutLoadBefore</method>
                    </vendor_observer>
                </observers>
            </controller_action_layout_load_before>
        </events>
    </frontend>
</config>

app/code/local/Vendor/Layout/Model/Observer:
<?php
class Vendor_Layout_Model_Observer {
    public function controllerActionLayoutLoadBefore(Varien_Event_Observer $observer) {

        $update = $observer->getEvent()->getLayout()->getUpdate();
        $handles = $update->getHandles();

// determine if it is a cms_page
        if(in_array('cms_page', $handles)) {

// create and add unique handle
            $identifier = 'cms_page_'.str_replace('/', '_', Mage::getSingleton('cms/page')->getIdentifier());
            $update->addHandle($identifier);

// parse layout file and add it
            $filename = Mage::getSingleton('core/design_package')->getLayoutFilename('vendor/cms_page.xml');
            $cmsLayoutUpdate = file_get_contents($filename);
            $update->addUpdate($cmsLayoutUpdate);
        }
    }
}

Results:
The entire file is added, producing an error if the <?xml version="1.0"?> tag is included in layout/vendor/cms_page.xml and if I remove the tag, the the file is added with the handles included which prevents the rules from being processed.
I tried using substring and strpos/strrpos to isolate the xml-string between the handle, but that has to be wrong because I would basically be reinventing the wheel.  Any help is appreciated!


texts:
I have a development system, display_errors is on, Magento is in developer mode and I tried to

Mage::log($layered_navigation_filter_block); // Mage_Catalog_Block_Layer_Filter_Attribute

And everything was written to the screen instead of the log file, why?

It looks like this case:

// app/Mage.php:837
if (is_array($message) || is_object($message)) {
    $message = print_r($message, true);
}

but the second argument from the print_r is ignored:

Mage_Catalog_Block_Layer_Filter_Category Object ( [_filter:protected] => ...

[28-Jan-2013 22:48:43 UTC] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 241434624 bytes) in /var/www/app/code/local/MyCompany/Motif/Model/Observer.php on line 47
[28-Jan-2013 22:48:43 UTC] PHP Stack trace:
[28-Jan-2013 22:48:43 UTC] PHP   1. {main}() /var/www/index.php:0
[28-Jan-2013 22:48:43 UTC] PHP   2. Mage::run() /var/www/index.php:87
[28-Jan-2013 22:48:43 UTC] PHP   3. Mage_Core_Model_App->run() /var/www/app/Mage.php:683
[28-Jan-2013 22:48:43 UTC] PHP   4. Mage_Core_Controller_Varien_Front->dispatch() /var/www/app/code/core/Mage/Core/Model/App.php:354
[28-Jan-2013 22:48:43 UTC] PHP   5. Mage_Core_Controller_Varien_Router_Standard->match() /var/www/app/code/core/Mage/Core/Controller/Varien/Front.php:176
[28-Jan-2013 22:48:43 UTC] PHP   6. Mage_Core_Controller_Varien_Action->dispatch() /var/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:250
[28-Jan-2013 22:48:43 UTC] PHP   7. Mage_Catalog_CategoryController->viewAction() /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php:419
[28-Jan-2013 22:48:43 UTC] PHP   8. Mage_Core_Controller_Varien_Action->generateLayoutBlocks() /var/www/app/code/core/Mage/Catalog/controllers/CategoryController.php:146
[28-Jan-2013 22:48:43 UTC] PHP   9. Mage_Core_Model_Layout->generateBlocks() /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php:344
[28-Jan-2013 22:48:43 UTC] PHP  10. Mage_Core_Model_Layout->generateBlocks() /var/www/app/code/core/Mage/Core/Model/Layout.php:210
[28-Jan-2013 22:48:43 UTC] PHP  11. Mage_Core_Model_Layout->_generateBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:205
[28-Jan-2013 22:48:43 UTC] PHP  12. Mage_Core_Model_Layout->addBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:239
[28-Jan-2013 22:48:43 UTC] PHP  13. Mage_Core_Model_Layout->createBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:472
[28-Jan-2013 22:48:43 UTC] PHP  14. Mage_Core_Block_Abstract->setLayout() /var/www/app/code/core/Mage/Core/Model/Layout.php:456
[28-Jan-2013 22:48:43 UTC] PHP  15. Mage::dispatchEvent() /var/www/app/code/core/Mage/Core/Block/Abstract.php:239
[28-Jan-2013 22:48:43 UTC] PHP  16. Mage_Core_Model_App->dispatchEvent() /var/www/app/Mage.php:447
[28-Jan-2013 22:48:43 UTC] PHP  17. Mage_Core_Model_App->_callObserverMethod() /var/www/app/code/core/Mage/Core/Model/App.php:1317
[28-Jan-2013 22:48:43 UTC] PHP  18. MyCompany_Motif_Model_Observer->coreBlockAbstractPrepareLayoutAfter() /var/www/app/code/core/Mage/Core/Model/App.php:1338
[28-Jan-2013 22:48:43 UTC] PHP  19. print_r() /var/www/app/code/local/MyCompany/Motif/Model/Observer.php:47

Ok, a fatal error happens, no shutdown_function is registered, so why is the print_r echoed? :-) I still don't understand what is happening.


texts:
I'm unfamiliar with the release cycles overall and want to install Magento but at the same time have some community extensions available.
I've looked at the downloads page and ver 2.0.10 and ver 2.1.2 is available. If I installed the former ver 2.0.10 which version is next ? Is it ver 2.1.0 ?

Which is best that allows for additional extensions?

Thanks


texts: How to set field select option value selected in admin form?

texts:
i set the value for select field in admin form like this

$categories = Mage::getModel('test_yeezy/test')->getCollection();
        foreach ($categories as $category) {
          $values[] = array(
                        'value'     => $category->getCategoryId(),
                        'label'     => $category->getCategoryName()
                      );
        }

$fieldset->addField(
            'attribute_magento',
            'select',
            array(
                'name'   => 'attribute_magento0',
                'container_id' => 'attribute-magento0',
                'values' => $values,
        ));

the first value selected always the first record of the data, is there anyway to make the value selected first if it's not the first data, for example in html goes like this:

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="vw" selected>VW</option>
  <option value="audi">Audi</option>
</select>


texts: Load all payment methods in system config

texts: I want to load all available payment methods in a multiselect system config in admin. Could some one help?


texts: How to shown Layered navigation like shop by categories or shop by brand on left side of CMS page, in Magento 2.3.5


texts: Currency changes not works in email template if changed from cart page

texts: Can someone please help in finding out the right place where data is being fetched by Magento in order to make email template for bundle items. Here, the price for main bundle product is showing with correct currency and conversion but for the bundle items - only currency is correct and a price is showing in INR. The problem occurs only in the order email templates only. It is working fine everywhere else.


texts:
As per the magento documentation guide logo can be uploaded from the backend in the Header section. See reference link.

But I am totally sucked with my magento 2.1 backend that there is no such section.


texts: add upload image field in Advanced Attribute Properties section magento 2

texts: how to add a new image upload field in Advanced Attribute Properties tab in attribute edit form in magento 2


texts: Extension attributes to add product attribute to the order summary on checkout?

texts:
I am trying to display a custom product attribute under the order summary list of items on checkout. I think it is fed by the TotalsItemExtensionInterface. I have the following trying to add the custom attribute to the collection exposed on the front end.

<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\TotalsItemExtensionInterface">
    <attribute code="product" type="string">
        <join reference_table="catalog_product" reference_field="product_id" join_on_field="entity_id">
            <field>custom_attribute</field>
        </join>
    </attribute>
</extension_attributes>
</config>

Any ideas on how this is done to attach a product attribute to a quote item in Magento 2?

EDIT: Attached is the screenshot of where I would like to get the attribute to show:

Also I am taking a different route, but have the same problem. I brought the attribute to the quote item through a migration so is now part of the quote_item table. But not part of the collection coming through. Any idea on how I get that attribute as part of the quoteItem object?


texts: Bulk edit of up-sell / cross-sell product items

texts: When I want to add a up-sell or cross-sell to an entire product-line, it becomes very tedious to edit one product at a tiem to modify those products.  It would be nice to select a group of products and perform an action like 'add cross-sell item'  or 'remove cross-sell item' in bulk.


texts: Magento 2.1 Admin login issue - Someone logged into this account from another device session is terminated

texts:
Magento 2 admin login issue when trying to do multiple admin login from different PC or location, its automatically logout from the PC where trying to do second login with same admin user in different pc - it gives Following error

  Someone logged into this account from another device or browser. Your current session is terminated.


texts: How can you display individual discounts in the cart?

texts:
By default Magento totals up any discounts in the cart. I have a scenario where I would like to show 2 (or more) discounts that can be applied, but unfortunately they are totaled up.

Example:

Discount 1: 10$

Discount 2: 1.00$

Discount 3: 2.00$

Currently displays as:

Discount 1, Discount 2, Discount 3: 13$

How can I modify the template or override this default behavior?


texts: Magento 2 : set value in session from js file

texts:
I want to save string from js file in session because i want to use that value in controller. How to save value in session from js file.

I want to save one string which size is 200kb. so i want to save it in session.

Is there any other way to pass value from js to controller then please mention in answer.

I want to passed value without using ajax. so how to set value in session.


texts:
I can not understand please help.
In his module I use catalog_controller_product_init event

config.xml

<frontend>
    <catalog_controller_product_init>
        <observers>
            <ZM_Digi_stock_price_update>
                <class>ZM_Digi_Model_Observer</class>
                <method>updateProduct</method>
                    <type>singleton</type>
            </ZM_Digi_stock_price_update>
        </observers>
    </catalog_controller_product_init>
</frontend>

observer.php

public function updateProduct($observer)
    {
        $product = $observer->getProduct();

        if (Mage::helper('digi')->getAtributeSet($product) == 'Digi') {
            Mage::getSingleton('digi/digi')->updateStockStatus($product);
            Mage::getSingleton('digi/digi')->updatePrice($product);
        }
    }

Digi.php (model)

public function updateStockStatus($product)
    {
        $product_digid = Mage::helper('digi')->getProductDigiId($product);
        $digi_stock = Mage::helper('digi')->getInstock($product_digid);
        $stock_item = Mage::getModel('cataloginventory/stock_item')->assignProduct($product);
        $store_stock = $stock_item->getIsInStock();
        if ($store_stock != $digi_stock) {
            if ($digi_stock == 0) {
                $stock_item->setQty(0);
                $stock_item->setIsInStock(0);
                $stock_item->save();
            } else {
                $stock_item->setQty(1);
                $stock_item->setIsInStock(1);
                $stock_item->save();
            }
        }
    }

    public function updatePrice($product)
    {
        $store_price = $product->getFinalPrice();
        $digi_price = Mage::getModel('digi/digi')->digiPrice($product);
        if ($store_price != $digi_price) {
            if ($digi_price != ''){
                $product->setPrice($digi_price);
                $product->getResource()->saveAttribute($product, 'price');
            } else{
                $product->setPrice(0);
                $product->getResource()->saveAttribute($product, 'price');
            }
        }
    }

Model update availability and prices of products.

This code is a good work out in the admin area, but on the site update prices and availability in two stages.
1 page loading. Record the new values (see the oldest)
2 page loading. We see the new values.

I understand the matter in the boot sequence

I tried using catalog_controller_product_init_before event
but this event does not contain any information on the product ...

I want to ask how it is possible to implement, and update, and display in one page load?


texts:
I've just started on magento 2, read (most) of the documentation and started my project. I want to create custom homepage first with my own header/section/footer (NOT the one that comes by default). I already have it done through html&css like static stuff so I "just" need to make it Magento 2 way.

Untill now I have created a theme, registered it, chose it and in my theme folder I have Magento_Theme folder which contains page_layout folder and layouts.xml. Page_layouts folder contains homepage.xml

so my homepage.xml looks like this

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
    </referenceContainer>
</layout>

and my layouts.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="homepage">
        Custom Homepage
    </layout>
</page_layouts>

When I navigate to admin / content / pages I can set my layout to Home page, but when i comment out <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" /> from homepage.xml it changes nothing. I also tried adding remove="true", nothing changed.. I also tried to edit htmlClass name and check it out in inspector - nothing changed.

How can I remove magento header/footer content on homepage.xml and add my own html&css? Would be awesome if someone can give me a simplest example that will add a
test
 to my homepage.xml so when I go to localhost I only get that div, without Magento header/footer.


texts: Custom table sql scripts not loading magento

texts:
Here is my config and Model classes.

I have changed the version number in both the config and sql installer.

But still the custom table doesnt seem to be added in core_resource table.

Where am i wrong?

 <config>
 <modules>
    <Vendor_Recipe>
        <version>1.0.1</version>
    </Vendor_Recipe>
</modules>
<global>
     <resources>
        <vendor_recipe_setup>
            <setup>
                <module>Vendor_Recipe</module>
                <class>vendor_Recipe_Model_Resource_Setup</class>
            </setup>
        </vendor_recipe_setup>
    </resources>

    <models>
        <vendor_recipe>
            <class>Vendor_Recipe_Model</class>
            <resourceModel>vendor_recipe_resource</resourceModel>
        </vendor_recipe>

        <vendor_recipe_resource>
            <class>Vendor_Recipe_Model_Resource</class>
            <entities>
                   <spen_recipe>

spen_recipe

                    </spen_recipe>
             </entities>
        </vendor_recipe_resource>

     </models>
   </global>
    ....

Vendor\Recipe\sql\vendor_recipe_setup\install-1.0.1.php

<?php

 $installer = $this;

 $installer->startSetup();

 $table = $installer->getConnection()
->newTable($installer->getTable('vendor_recipe/spen_recipe'))
->addColumn('vendor_recipe/recipe_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'identity'  => true,
    'unsigned'  => true,
    'nullable'  => false,
    'primary'   => true,
    ), 'Recipe ID')
->addColumn('vendor_recipe/user_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    ), 'USer ID');
$installer->getConnection()->createTable($table);

vendor\Recipe\Model\SpenRecipe.php

<?php
class vendor_Recipe_Model_SpenRecipe extends Mage_Core_Model_Abstract
{
    protected function _construct()
    {
        $this->_init('vendor_recipe/spen_recipe');
    }
}

\Recipe\Model\Resource\SpenRecipe.php

<?php

class vendor_Recipe_Model_Resource_SpenRecipe extends Mage_Core_Model_Resource_Db_Abstract
 {
   protected function _construct()
  {
    $this->_init('vendor_recipe/spen_recipe', 'recipe_id');
  }
}

\Recipe\Model\Resource\SpenRecipe\Collection.php

<?php
class vendor_Recipe_Model_Resource_SpenRecipe_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
    public function _construct()
    {
        $this->_init('vendor_recipe/spen_recipe');
    }
}