texts: How to modify the number of articles displayed on the homepage?

texts:
I have a question regarding the CMS pages of the Magento RWD theme.
I use the version 1.9.2.4 of Magento.

1- I added blocks and templates to call the categories in the "Madison Island" pages of CMS.

Here are the blocks I added:

   {{block type="catalog/product_list" category_id="4" column_count="4" product_count="4" template="catalog/product/cms-home-category-slide.phtml"}}

{{block type="catalog/product_list" category_id="5" column_count="4" product_count="4" template="catalog/product/cms-home-category-slide.phtml"}}

I also tried for example  product_count="4" or limit_count="4"but it didn't work.

2- I could check that the blocks in in WOMEN and MEN I added in "Madison Island" were displayed in the front end.

Here is a sreenshot of the front end.

3- But the number of items displayed is the one written in System > Configuration > CATALOG > Catalog > Frontend , and not the number written in the blocks.

Here is a screenshot of the number displayed in the frontend.

4- I want to display the number of items as I wrote it in the {{block .....}} . How could I do that?


texts: In Magento2, I want to add cms page link in header top menu before wishlist link

texts:
In Magento 2, I want to add custom cms page link in header menu before wishlist link.

Please tell me how we can add custom page link before wishlist link?


texts: Error processing request: Illegal scheme supplied, only alphanumeric characters are permitted

texts:
We're on Magento 1.9. Our website is displaying an error: There has been an error processing your request.

please give the solution..


texts: How to filter grid by custom column -magento2

texts:
I have custom column(testname) in admin grid for custom module Where current table of module is Table A and testname is store in Table C But Table B joins both tables.I have displayed value in the grid with join as Below :

<column name="testname" class="Vendor\Namespace\Ui\Component\Listing\Column\TestName">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">select</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="sortable" xsi:type="boolean">false</item>
            <item name="label" xsi:type="string" translate="true">TestName</item>
        </item>
    </argument>
</column>

public function prepareDataSource(array $dataSource)
{
    foreach ($dataSource['data']['items'] as & $item)
    {
        $groupsarr=array();
        $resultPage = $this->_modelItemsFactory->create();
        $collection = $resultPage->getCollection();
        $Collection1 = $collection->addTableC()->addTableB($item['tablea_id']);

        foreach($Collection1 as $TestName)
        {
            $groupsarr[]=$TestName->getName();
            $item['testname']= implode(', ', $groupsarr);
        }
    }

    return $dataSource;
}

It works perfect and showing the column name but how can i add those values in filter and how to filter result with this column?


texts: Remove Categories from Layered Navigation - Magento 2

texts: I would like to remove the categories section on the layered navigation but do not see where they are called within layered navigation module.


texts: Magento 2 Admin user can't access Admin menus

texts:
I have a Magento 2.4.1 admin instance, I have created a Admin user through command line,
But am able to login but cant access anything. how to to add this permission to admin user.

I cant access these Menus. How to fix this. Can I get help.? thank you in advance.


texts: Implementing a persistent cart for guests

texts:
I see a lot of posts in regards to the built in persistent cart not working as expected, IE - doesn't work for guests. What I'm trying to do is actually implement it.

It seems fairly easy. Store the quote ID in a cookie and load it and assign it to the session the next time the customer comes back. However I'm not having success. I've worked my way through the code when a guest first adds an item to their cart. My thought was that code would show me how to initialize a cart. Instead of initializing I'd load an existing cart. I've assigned the loaded quote to the checkout session and cart singleton but it still shows me no items when I visit the cart page.

Can someone point me in the right direction? I'll keep digging in the meantime.


texts: Magento2 : Import/Export is not visible in Admin section

texts:
I am having an issue in Magento Admin. The import/export menu is not visible. When I open the URL directly, It shows a blank page.

Please help, it's urgent.


texts:
I need to change the order grid in the admin area, and add in a column for Margin (ie, total margin on each order). I have set up code\local\MageWorx\Adminhtml\Block\Orderspro\Sales\Order\Grid.php with

$this->addColumn('margin', array(
    'renderer'  => 'mageworx/orderspro_sales_order_grid_renderer_margin',
    'type'  => 'currency',
    'currency' => 'order_currency_code',
    'header' => $helper->__('Margin'),
    'index' => 'total_margin'
));

Then I have Sales\Order\Grid\Renderer\Margin.php which has the following:

class MageWorx_Adminhtml_Block_OrdersPro_Sales_Order_Grid_Renderer_Margin extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    public function render(Varien_Object $row)
    {
        $orderItems = Mage::getModel('sales/order')->getCollection();
        $totalMargin = 0;

        foreach ($orderItems as $item) {
            $totalMargin += $totalMargin->getMarginR();
        }
        return $totalMargin;
    }

    public function getMarginR()
    {
        //each individual margin
        $x = 0;
        $x = ($this->getPrice() * $this->getqty_ordered()) - ($this->getData(mage::helper('purchase/MagentoVersionCompatibility')->getSalesOrderItemCostColumnName()) * $this->getqty_ordered());

        return $x;
    }
}

This just gives me a blank page.

If I take out the foreach loop and just have something like this:

$orderItems = Mage::getModel('sales/order')->getCollection();
$totalMargin = "hi";

//foreach ($orderItems as $item) {
//    $totalMargin += $totalMargin->getMarginR();
//    $totalMargin = 1;
//}
return $totalMargin;

I get "hi" in each field, so I think the getCollection bit is working, I think the problem is in the foreach. Even if I take out the

$totalMargin += $totalMargin->getMarginR();

line and just try to loop and do nothing of consequence it just gives a blank page.

Fairly new at this but what am I missing? Thanks. Could it be that the collection is empty, am I calling it wrong?

var/log/system.log has nothing.


texts: Magento 2.3.2 Enterprise Banner Slider Issue

texts: I am experiencing that the default banner slider is not compatible with the mobile devices in Magento 2.3.2 enterprise version. Slider is working fine for the desktop. Can anyone help me to understand the best approach to fix it ?


texts: Javascript point to Folder: Solution and Tool

texts:
We are updating our store to Magento 1.9.2 and we are in the testing phase. The store is using Ultimo theme.

On all product pages there is a error in the header, which refers to the following line:

 <script type="text/javascript"
    src="http://www.mystore.com/skin/frontend/ultimo/default/">
 </script>

The JavaScript is pointing to a folder, not to a file.
So the file cannot be found and trying to access the folder return a "403 Forbidden" error

First question: how can we solve it?

The second (and more interesting): is there a way/tool to understand which part of Magento – plug-in, theme, core, other – is generating that line?


texts:
In home page you can see "BEST sELLER " & "ON SALE"

Please help me to remove those. Those are widgets in galagiftshop theme.

I changed widget from "ALL store views" to "Pinkview".

So Products which were under BEST sELLER  & ON SALE are removed. BUt those

"BEST sELLER  & ON SALE" text are still displaying in other "store views".

Please help me to find solution.

thanks in advance.


texts: New tab in system configuration auto selected and 404 error

texts:
I create a system tab but when I click Configuration then It selected my tab which order 200 (after catalog) and when i click My custom tab option it's give me a 404 page

My system.xml is

<config>
<tabs>
    <firstnewtab>
        My custom tab
        <sort_order>200</sort_order>
    </firstnewtab>
</tabs>
<sections>
    <mytab_options>
        My custom tab options
        <tab>firstnewtab</tab>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>
        <groups>
            <my_options1>
                Options
                <frontend_type>text</frontend_type>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <sort_order>30</sort_order>
                <fields>
                    <percent translate="label">
                        Label 1
                        <frontend_type>text</frontend_type>
                        <sort_order>1</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </percent>
                </fields>
            </my_options1>
            <my_options2>
                Options2
                <frontend_type>text</frontend_type>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <sort_order>40</sort_order>
                <fields>
                    <percent2 translate="label">
                        Label 2
                        <frontend_type>text</frontend_type>
                        <sort_order>1</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </percent2>
                </fields>
            </my_options2>
        </groups>
    </mytab_options>
</sections></config>

UPDATE
config.xml

<config>
<modules>
    <Alanstormdotcom_Helloworld>
        <version>1.0.0</version>
    </Alanstormdotcom_Helloworld>
</modules>
<global>
    <helpers>
        <helloworld>
            <class>Alanstormdotcom_Helloworld_Helper</class>
        </helloworld>
    </helpers>
</global></config>


texts: Magento 2.2.X How to create system.xml in admin panel and show & hide field based on parent (depends)

texts:
Step 1 : Create a new module (app/code/)

  Step 2 : Create system.xml
  (app/code/vendor/module_name/etc/adminhtml/system.xml)

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="dckap_configuration" translate="label" sortOrder="10">
            Dckap
        </tab>

            <class>separator-top</class>
            Dckap Configuration
            <tab>dckap_configuration</tab>
            <resource>Dckap_AdminConfiguration::configuration_config</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                General Configuration
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    Enable
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="connection_settings_header" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    Hide Field
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="enable">1</field>
                    </depends>
                </field>
            </group>

    </system>
</config>

  step 3 : Create a config.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <configuration>
            <general>
                <enable>1</enable>
            </general>
        </configuration>
    </default>
</config>

  step 4 : Finally run setup:deploy commmand

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush


texts: How to set Shipping prices for different customers over Owebia Advanced Shipping module?

texts:
We are trying to set customers shipping prices individually. We try to use Owebia Advanced Shipping open source module.
I know that there is a variable {customer.id}, but the documentation does not mention where and how I can use it. I am also interested in filtering customer according certain attribute e. g. {client.attribute.[some atribute name]}.


texts: How to create custom tab in product edit page in magento 2.0.7

texts:
Magento 2.0.7: How to create a custom module that will add a new tab on product edit page, right under Basic Settings and i want to display my custom phtml page. ?

view\adminhtml\layout\catalog_product_new.xml

<?xml version="1.0"?>
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
  <referenceBlock name="product_tabs">
   <block class="Magento2\Tutorial9\Block\Adminhtml\Product\Edit\Tab\Welcome" name="product.welcome" as="custom-tab" >
    <arguments>
     <argument name="config" xsi:type="array">
      <item name="label" xsi:type="string" translate="true">Product Welcome</item>
      <item name="collapsible" xsi:type="boolean">true</item>
      <item name="opened" xsi:type="boolean">true</item>
      <item name="sortOrder" xsi:type="string">2</item>
      <item name="canShow" xsi:type="boolean">true</item>
      <item name="componentType" xsi:type="string">fieldset</item>
     </argument>
    </arguments>
  </block>
</referenceBlock>

Block\Adminhtml\Product\Edit\Tab\Welcome.php

namespace Magento2\Tutorial9\Block\Adminhtml\Product\Edit\Tab;
use Magento\Backend\Block\Template\Context;
use Magento\Framework\Registry;
class Welcome extends \Magento\Framework\View\Element\Template{
 protected $_template = 'catalog/product/edit/welcome.phtml';
 protected $_coreRegistry = null;
 public function __construct(
   Context $context,
   Registry $registry,
   array $data = []
 )
 {
    $this->_coreRegistry = $registry;
    parent::__construct($context, $data);
}
public function getProduct(){
   return $this->_coreRegistry->registry('current_product');
}   }

view\adminhtml\templates\catalog\product\edit\welcome.phtml

<div class="welcome">
    <?php echo __('Welcome !'); ?>
</div>

etc\module.xml

<?xml version="1.0"?>
   <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
  <module name="Magento2_Tutorial9" setup_version="1.0.0">
</module>

registration.php

<?php \Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Magento2_Tutorial9',
__DIR__
);


texts: How to Modify Discount amount of cart price rule on cart page in magento 2

texts:
I would like to modify Discount Amount of cart price rule on the cart page. Actually Magento apply rule using class Magento\SalesRule\Model\RulesApplier and function is protected function setDiscountData($discountData, $item)

So for that, I create a preference to modify Discount Amount

<preference for="Magento\SalesRule\Model\RulesApplier" type="Namespace\Modulename\Model\RulesApplier" />

And my logic like below :

<?php
namespace Namespace\Modulename\Model;

use Namespace\Modulename\Model\Source\ShowCoupon;
use Magento\SalesRule\Model\Quote\ChildrenValidationLocator;
use Magento\SalesRule\Model\Rule\Action\Discount\CalculatorFactory;
use Namespace\Modulename\Model\Source\PromotionType;

class RulesApplier extends \Magento\SalesRule\Model\RulesApplier
{
    /**
     * @var \Magento\SalesRule\Model\ResourceModel\Rule\Collection
     */
    protected $rules;

    /**
     * @var \Magento\SalesRule\Model\Utility
     */
    protected $validatorUtility;

    public function __construct(
        CalculatorFactory $calculatorFactory,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        \Magento\SalesRule\Model\Utility $utility,
        \Magento\SalesRule\Model\ResourceModel\Rule\CollectionFactory $rulesFactory,
        ChildrenValidationLocator $childrenValidationLocator = null
    ){
        $this->ruleCollection = $rulesFactory;
        parent::__construct($calculatorFactory, $eventManager, $utility, $childrenValidationLocator);
    }

    protected function setDiscountData($discountData, $item)
    {
        $item->setDiscountAmount(0);
        $item->setBaseDiscountAmount(0);
        $item->setOriginalDiscountAmount(0);
        $item->setBaseOriginalDiscountAmount(0);

        $quote = $item->getQuote();
        $quote->setCustomAmount($discountData->getAmount());
        $quote->setBaseCustomAmount($discountData->getBaseAmount());
        //echo '<pre>';print_r($quote->debug());die;
        return $this;
    }
}

In the above code, I am trying to set discount amount to zero and I want to set that discount amount to my custom fee value. but unfortunately, it is not working.

So I debug that and found that if you set $item->setDiscountAmount(0); to zero then the value is not set to your custom fee. so can someone help me to solve out this issue? what's I am doing wrong or is there any other method available?

In short, I would like to set discount amount to may custom fee and default discount amount($item->setDiscountAmount(0)) to zero at the same time same file

Any help would be appreciated! Thanks.


texts: Magento2 disabled product quantity text field to product edit page at admin panel

texts:
How can we disable quantity text fields of product edit form at admin side or how can we make it ready only?

We found that it's already disabled with bundle product but we want to do this with all type of products.

Any help or suggestion will be appreciated. Thank you in advance.


texts: Magento add item to Product Collection but not showing up

texts:
I have a product Collection:

$_productCollection = Mage::getResourceModel('catalog/product_collection')->getCollection()->setPageSize(10);

I want to add a product to that collection by using addItem() method:

$product = Mage::getModel('catalog/product')->load(66);
$_productCollection->addItem($product);

I tried to dump my $_productCollection before and after using addItem() method but I get the same result.

What's wrong with that ?
Thanks in advance


texts:
I know it's not recommended but I want to upload product images to any folder in my web server's root directory instead of magento's media folder.

<upload_dir config="system/filesystem/media" scope_info="1">sales/store/logo</upload_dir>

The base image upload path is set with the config attribute (system/filesystem/media above).
I've updated system config value Base Media URL to http::/127.0.0.1/external.
But I don't see my product images being saved in http::/127.0.0.1/external folder once image is uploaded and product is saved.

Can anyone share where is the actual upload image code present? I've checked in Mage_Catalog_Model_Product_Attribute_Backend_Media::addImage() by doing Mage::log() but I think this function is not being called?


texts: Add text to adress field onepage checkout

texts: I want to add text above the 2nd and 3rd line of the address field on the onpage checkout. How can I do this best?


texts: pulling order IDs via REST API in magento 2.0

texts:
we are seeing a big dependency between the order ID that we are getting from Magento via REST and the order ID that we see in the order confirmation email. for example REST returns 45, the email has 200045646.

We implemented the increment features directly into the SQL database based on some posts here but it seems that REST APIs pull the original non incremented order ID.  anyone was able to address this issue ?

We are using Magento as a backend an d talking to it via REST API


texts: Magento 2 Price of configurable is zero on store front

texts: We make an import of CSV with products programmatically and getting prices $0.00 on the storefront for the first time. After some minutes it's getting normal. I am using Magento 2.2.9 Community Edition. I believe it's some issue with reindex or something..there are many products and we can't make full reindex after each import.


texts: Magento2 - how to know when what parameter i have to pass in controller - _construct function

texts:
i was reading a book magento2 tutorial. When learning how to create module. 2 augments was receiving in _construct function of controller.

Actually i am talking about this 2

\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory

how to know when which augment i have to use? i.e when working with product, order, customer. for example i saw that in other tutorial for get product list i have to use some like productfactory

Below is complete code for that controller

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


texts: How to add custom category product position base on country and sort in Magento 1.9.x?

texts:
In Magento default catalog category product sort by position.

I would like to add custom product position base on country in Magento CMS category.

In the frontend product sort depending on the visitor country. If there is no catalog country position available in the CMS then it will sort by default position.

Example : I have some categories and their products. Each category products popularity/position is different depending on countries(USA Position and India Position). So I need add two more position column (uas_position india_postion) and sort depending on set position.

How I will achieve this functionality?

Note: Using IP2Location I get visitor country.


texts:
I'm attempting to create a new product via an install script, but running into some issues, more specifically when trying to save the product.

The error I'm getting is: Call to a member function getStoreIds() on a non-object

I've isolated the error to when the product saves (see below)

When saving the product the function _saveAttributeValue is called from Mage_Catalog_Model_Resource_Abstract

Within this function the following line is throwing an error $storeIds = Mage::app()->getStore($storeId)->getWebsite()->getStoreIds(true);

This is because when calling Mage::app()->getStore() from an installer script 0 is returned instead of proper store (see: Install script to get access to root category id)

Is there any way around this where I can the product to save


texts:
I want to develop pagination of custom collection using knockout.

How to implement it?

Any help would be appreciated.

Thanks.


texts:
I want to restrict compare products for guest when guest compare 3 products.

How can i do that ?

I tried the following code but not worked for guest. It is working for registered users only.

In My di.xml file

<type name="Magento\Catalog\Controller\Product\Compare\Add">
        <plugin name="LimitToCompareProducts"
                type="Vendor\Catalog\Model\Plugin\Compare\LimitToCompareProducts"/>
    </type>

In My modal file

if($count >= 3) {
        $this->messageManager->addErrorMessage(
            'You can add the compared products under 3 item(s)'
        );


texts: Issue with invoice subtotal and grandtotal

texts:
I made custom calculation to change product price on cart page.

Product type is bundle. And bundle product price type is dynamic.

Calculation is working fine my custom calculation is display in order info but when I create invoice from order my custom calculation is not taking effect in invoice grand total and subtotal.

I know bundle product price type is dynamic so when prepareInvoice method is called for creating invoice it called $invoice->collectTotals();  and this method further recalculate associated product price so my custom calculation is not taking effect.
So what is solution for this???


texts: removing javascript and CSS from Search pages

texts:
i have been removing java scripts and CSS files which are not needed on certain pages I have managed to do this for my homepages, my category pages and my product pages but i am struggling to do it for my search page. This is the code i am adding:

    <catalogsearch_result_index>
    <reference name="head">
            <action method="removeItem"><type>skin_css</type><stylesheet>CSS file path</stylesheet></action>
    </reference>

I assume i need to change catalogsearch_result_index but i am not sure what to


texts:
Getting "Missing PHP Extension bcmath"  error while doing Readiness check while doing Magento 2 setup. Even though, I have installed latest PHP bcmath - 7.0

Please help me to resolve this.


texts:
I want to remove the coupon code from magento invoice.

essentially the second row must look like

Discount : -Rs374.90

Any help would be highly appreciated


texts:
i am working with the magento(1.9.0.1),unfortunately i got the following text in footer are
the text is
 "text [profiler] Memory usage: real: 18087936, emalloc: 17499024"


texts: Magento 2 - sorting order of products in a widget block

texts:
I created a block and a widget in admin panel to show products that fit some criteria(in a specified category) on home page.

When I finished the setting, I found that the sorting order of the products showing in the homepage did not match with the sorting order assigned in the category.

How can I make the products to show in the correct order?


texts:
How to remove Company field from checkout process in Magento 2? I've been looking for the template but have not found it.

Update: Is there any way to remove this field via layout or template?


texts: IWD Checkout suite - No Payment method available. Magento 2

texts:
I have the IWD Checkout suite as Onestepcheckout. But there is a mistake. When you are in checkout you will see "No Payment method available" until the customer enter all informations and choose shipping method. After that Payment Method will show up.

How can i change this?

5 customer write an email everyday about this issue on our site.


texts:
I want to add a custom field to the review form in Magento.
I have tried this but the data is not saved, it shows the field.

app\code\core\Mage\Adminhtml\Block\Review\Edit\Form.php

$fieldset->addField('email', 'text', array( // New field 1
'label' => Mage::helper('review')->__('Email'),
'required' => true,
'name' => 'email'
));

After

$fieldset->addField('nickname', 'text', array(
'label' => Mage::helper('review')->__('Nickname'),
'required' => true,
'name' => 'nickname'
));

app\design\frontend\theme\theme\template\review\form.phtml

            *<?php echo $this->__('E-mail') ?>

                <input type="text" name="email" id="email_field" class="input-text required-entry" value="<?php echo $this->htmlEscape($data->getEmail()) ?>" />

app\code\core\Mage\Review\Model\Resource\Review.php

protected function _afterSave(Mage_Core_Model_Abstract $object)
{
$detail = array(
'title' => $object->getTitle(),
'detail' => $object->getDetail(),
'nickname' => $object->getNickname(),
'email' => $object->getEmail(), // New field 1
);

What am I missing?


texts:
How do you create a custom router for two related pages?

About us and person page. The URL structure would be like so http://example.com/about-us/ and http://example.com/about-us/john. There will be multiple people, so the people's page URL can't be hardcoded i.e. about-us/mike, about-us/jane.


texts:
On October 22, 2015, Magento will release security patch SUPEE-6788. According to the technical details, 4 APPSEC's that have been fixed require some rework in local and community modules. I'm trying to fix one on my modules but cant seem to get the admin routing working correctly. The extension pages cant be found anymore (404). Here are my files ...

\app\code\community\SolideWebservices\Flexslider\etc\config.xml contains:

        <routers>
        <adminhtml>
            <args>
                <modules>
                    <flexslider after="Mage_Adminhtml">SolideWebservices_Flexslider_Adminhtml</flexslider>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

\app\code\community\SolideWebservices\Flexslider\etc\admin.xml contains:

<menu>
    <cms>
        <children>
            <flexslider translate="title" module="flexslider">
                <title>Flexslider</title>
                <sort_order>100</sort_order>
                <children>
                    <group>
                        <title>Manage Groups</title>
                        <sort_order>101</sort_order>
                        <action>adminhtml/flexslider/group</action>
                    </group>
                    <slide>
                        <title>Manage Slides</title>
                        <sort_order>102</sort_order>
                        <action>adminhtml/flexslider/slide</action>
                    </slide>
                </children>
            </flexslider>
        </children>
    </cms>
</menu>

And there are two controllers:

\app\code\community\SolideWebservices\Flexslider\controllers\Adminhtml\GroupController.php

class SolideWebservices_Flexslider_Adminhtml_GroupController extends Mage_Adminhtml_Controller_Action {

protected function _initAction() {
    $this->loadLayout();
    $this->_setActiveMenu('cms/flexslider');
    return $this;
}

public function indexAction() {
    $this->_initAction();
    $this->_addContent($this->getLayout()->createBlock('flexslider/adminhtml_group'));
    $this->renderLayout();
} ......

\app\code\community\SolideWebservices\Flexslider\controllers\Adminhtml\SlideController.php

class SolideWebservices_Flexslider_Adminhtml_SlideController extends Mage_Adminhtml_Controller_Action {

protected function _initAction() {
    $this->loadLayout();
    $this->_setActiveMenu('cms/flexslider');
    return $this;
}

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

protected function _isAllowed() {
    return Mage::getSingleton('admin/session')->isAllowed('cms/flexslider/slide');
} ....

What's going on, why is the admin routing not working?


texts:
I have checked fronted after migration from 1.9.2.1 to 2.1.6 but getting following error on frontend.

2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.catalog/category' doesn't exist, query was: SHOW INDEX FROM `catalog/category`
Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.catalog/category' doesn't exist

I used Magento 2 default migration tool.


texts: Magento2 Mixins: How to write a requirejs-config.js?

texts:
What exactly do I need to add to the requirejs-config.js for adding a mixin?

The Magento documentation has an example of this, but I seem to lack some basic understanding of javascript and frontend development.

var config = {
 config: {
     mixins: {
         'Magento_Ui/js/grid/controls/columns': {
             'OrangeCompany_Sample/js/columns-mixin': true
         },
         "Magento_Ui/js/modal/modal": {
             "OrangeCompany_Sample/js/modal-widget-mixin": true
         }
     }
 }
};

Why, for example, is it Magento_Ui/js/grid/controls/columns? It seems to refer to the file src/vendor/magento/module-ui/view/base/web/js/grid/controls/columns.js (this is the path with composer).

The text js/grid/controls/columns matches between file name and requirejs. Magento_Ui is the extension name. Does it mean, this is the syntax?

Syntax:
<module name>/<path of file in module>/<filename without extension>

Or is there any other way to determine; another logic?
I have the same question for the next line (OrangeCompany_Sample/js/modal-widget-mixin). Same syntax?

My specific case seems to have an additional hurdle: Most of the extensions are installed via composer and therefore in the vendor directory. But a handful of the 3rd party extensions is not able to use composer and therefore lives in app/code/<3rdparty>. Playing around with the paths in the requirejs-config.js file, I am able to address javascript files in the vendor folder, but not those in the app/code/... folder.


texts:
I am trying to locate the view.xml file in my magento2 installation.

I have no theme selected (i.e. I have not selected Luma or blank).

I want to resize my header image (height and width) but I cannot find the file location.

I have been using the following link: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-images.html

Can someone help please?


texts:
Data.php

    const XML_PATH_EMAIL_NOTIFICATION_TEMPLATE = 'order_attachments_receive_email_notification';

    public function getEmailAddress() {
    return Mage::getStoreConfig('orderattachments/order_attachments_general/send_email_notification_to')
    }

    static public function sendMail($orderId) {
    $order = Mage::getModel('orderattachments/orderattachments')->load($orderId);
    $attachmentId = $order->getOrderAttachmentsId();
    $orderId = $order->getOrderId();
    $comment = $order->getComment();
    $attachment = basename($order->getFile());
    try {
        $postObject = new Varien_Object();
        $post['order_id'] = $orderId;
        $post['comment'] = $comment;
        $post['file'] = $attachment;
        $postObject->setData($post);
        $customerEmail = Mage::helper('orderattachments')->getEmailAddress();

        $mailTemplate = Mage::getModel('core/email_template');

        $mailTemplate->setDesignConfig(array('area' => 'frontend'))
            ->setReplyTo($customerEmail)
            ->sendTransactional(
                Mage::getStoreConfig(self::XML_PATH_EMAIL_NOTIFICATION_TEMPLATE),
                array('email'=>$customerEmail),
                $customerEmail,
                       null,
                       array('data' => $postObject)
        );
        if(!$mailTemplate->getSentSuccess()) {
            throw new Exception('Not Sent');
        }
    }
    catch (Exception $e) {
        echo "
";
        print_R($e);
        $errorMessage = $e->getMessage();
        return $errorMessage;
    }
}

Controller

     Mage::helper('orderattachments')->sendMail($orderAttachmentModel->getOrderAttachmentsId());

config.xml

    <template>
        <email>
            <order_attachments_receive_email_notification translate="label" module="orderattachments">
                Order Attachments Notification
                <file>orderattachments/attachment_notification.html</file>
                <type>html</type>
            </order_attachments_receive_email_notification>
        </email>
    </template>

system.xml

    <send_email_notification_to translate="label">
                        Email Address
                        <frontend_type>text</frontend_type>
                        <sort_order>70</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
    </send_email_notification_to>

is this correct or not if not correct then tell me what is my mistake?


texts: Magento 2 - Set Category page layout dynamically

texts:
I tried set dynamically category page layout base on admin configuration.
But I can't set it use ifconfig.

Can you please help me set the layout dynamically.

Thanks in advanced.


texts: Load admin text label instead of the Default Store View Label on multi-list attribute

texts:
I'm trying to load the Admin Text Label instead of the translated Default store view label but can't figure out how to do it.Been searching for an answer for days.

<?php
$sportTypes = explode(",",$_product->getResource()
->getAttribute('foodpair')->getFrontend()
->getValue($_product));

foreach($sportTypes as $key => $value){
        echo $value;
    }
 ?>

The problem is, I can only get the default store label but not the admin one :(


texts: Adding wysiwyg editor to Magento 2 product attribute options page

texts:
I have managed to add a custom description field for product attribute options. Now I need to add WYSIWYG editor for the same. My custom module override the default templates for this
vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml

and added new textarea field

<script id="row-template" type="text/x-magento-template">
----
-----
    <td class="hoverarea-col-<%- data.id %>">

                    <textarea class="textarea" id="option[hover_area][<%- data.id %>]" name="option[hover_area][<%- data.id %>]" <?php if ($block->getReadOnly() || $block->canManageOptionDefaultOnly()):?> disabled="disabled"<?php endif;?>><%- data.hover_area %></textarea>
                </td>
-----
--
</script>

I tried to add tinyMCE.init() function to the template's JS file,but WYSIWYG is not working in these templates.

Can somebody help ?


texts: How do I set Magento up such that the storecode comes before the path to store in the URL? (Pre-path store code)

texts:
So; I'm currently setting up a Magento installation off the back of a WordPress multisite setup. The WP multisite has 2 sites/domains, and each site has 3 regional variants powered by mqTranslate; ala:

company1.tld/uk, company1.tld/us, company1.tld/eu
company2.tld/uk, company2.tld/us, company2.tld/eu

I have got Magento installed, and out of the box with Multistore I've got it to do:

company1.tld/shop/uk etc.

But for consistency and so the site is seen 'as one' by search engines I would prefer for the URL to be formatted as:

company1.tld/uk/shop etc.

Would appreciate any advice on how best to achieve this.

Edited to add:
I have attempted changing the base URL in the store, and coupled this with the following HTACCESS in the root:

  RewriteEngine On
  RewriteBase /

  RewriteRule ^([a-z]{2,3})/shop/(.*)/?$ /shop/index.php [QSA,L]
  RewriteRule ^([a-z]{2,3})/shop/?$      /shop/index.php [QSA,L]

When I then navigate to company1.tld/uk/shop, I get a Magento 404 error...


texts: Add View All link to show all products in Magento 2

texts: I am getting a problem to add View All button to show all products in Category page in the toolbar. How will I do this in Magento 2?


texts: how to create not cacheable helper method?

texts:
We have written logic to find client IP address in the custom helper.

public function getIpAddress(){
..............
return $ip;
}

It works only at first hit after that it only displays the old cacheable value.

what is the correct approach to get the dynamic values in the cached pages?

Note: We have referred some links link1,link2 but we don't need to display the value anywhere so we thought we don't need to use knockout js?


texts:
I'm getting the following error on my Magento 1.9.1 website:

Call to a member function setLock() on a non-object app/code/core/Mage/Index/Model/Lock.php on line 162

Below is lines 160 - 167 of the lock.php file.

  protected function _setLockDb($lockName, $block = false)
    {
        if ($this->_getLockStorage()->setLock($lockName)) {
            self::$_lockDb[$lockName] = $lockName;
            return true;
        }
        return false;
    }


texts: Create transactional email via install/upgrade script

texts: How can I create transactional email templates via an install/upgrade script? I need them populated in Transactional Emails rather than having email templates available in the app/locale folder.


texts: What is purpose of xmlconnect_notification_send_all cron job?

texts:
In magento xmlconnect_notification_send_all is a core cron job.

What is exact purpose and scope of xmlconnect_notification_send_all cron job?


texts: How to get the db updated at timestamp value form custom table in magento 2?

texts: I have to get the updated at value from db custom table. But if I print the value it is showing before 5 30 hrs. How to get the value in phtml file without using dependency injection.


texts:
is it possible to attribute every product with an price factor that is used for the calculation of the final price but not shown in the frontend.

In my special case the base price refers to 1000 pieces but every product is sold as an package of e.g. 2500 pieces (differs for every product). So my price factor would be 2.5.

Thanks so much for your help in advance.


texts: How should I optimize my images to the fullest?

texts:
I'm looking to upload my products into my Magento 2 store. However, before hand I want to make sure the images are correct.

I've resized my images to 600px in width (height depends on ratio), and compressed my images to around  20/30 KB each.

Are these images good to be uploaded onto my store?

I plan to use the same image for the variations of reasons per product? Shall I do this or resize images for each varietion (thumbnail, base, product page etc)?

Thanks


texts: Magento 2 How can I hide the price and total from cart and checkout summary?

texts:
I want to hide price and totals from cart/checkout Summary. You can see in below image.

How can I achieve this functionality with a custom module? Is there any common file from I can hide the price?

Thanks.


texts: M2: issue with cron table with language translator

texts:
I added a large number of CRON tasks to the translation table.
Now when I open this table I see an error:
Manage Cron
Warning: DOMDocumentFragment::appendXML(): Entity: line 1: parser error : CData section too big found in /home/shop/domains/domain.com/public_html/vendor/magento/framework/View/TemplateEngine/Xhtml/Template.php on line 60

Any solution?
code file template.php
/**
     * Append
     *
     * @param string $content
     * @return void
     */
    public function append($content)
    {
        $newFragment = $this->templateNode->ownerDocument->createDocumentFragment();
        $newFragment->appendXML($content);
        $this->templateNode->appendChild($newFragment);
    }


texts: How to add a class, if there is no sub-categories?

texts:
If category empty, add to class "empty".
I have this code.

<?php $_helper = Mage::helper('catalog/category') ?>
<?php $categoryId = 3;?>
<?php $category = Mage::getModel('catalog/category')->load($categoryId) ?>
<?php $_categories = $category->getChildrenCategories() ?>
<?php if (count($_categories) > 0): ?>

        <?php foreach($_categories as $_category): ?>

                <a class="roll-link1" href="<?php echo $_helper->getCategoryUrl($_category) ?>"><?php echo $_category->getName() ?>
                <?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>
                <?php if($_category->hasChildren()):?>
                <?php $_subcategories = $_category->getChildrenCategories() ?>

                        <?php foreach($_subcategories as $_subcategory): ?>

                                <a class="roll-link2" href="<?php echo $_helper->getCategoryUrl($_subcategory) ?>"><?php echo $_subcategory->getName() ?>
                                <?php $_category2 = Mage::getModel('catalog/category')->load($_subcategory->getId()) ?>
                                <?php if($_category2->hasChildren()):?>
                                <?php $_subcategories2 = $_category2->getChildrenCategories() ?>

                                        <?php foreach($_subcategories2 as $_subcategory2): ?>

                                                <a class="roll-link3" href="<?php echo $_helper->getCategoryUrl($_subcategory2) ?>"><?php echo $_subcategory2->getName() ?>

                                        <?php endforeach; ?>

                                <?php endif; ?>

                        <?php endforeach; ?>

                <?php endif; ?>

        <?php endforeach; ?>

<?php endif; ?>


texts: Reindex causes configurable product images to disappear?

texts:
Peculiar problem: We're using Magmi to import configurable & simple products and product images. We have about 6-7 images linked to the configurable product. These images should be displayed on the category page & product-detail page.

When we first import the products and look them up in the backoffice, everything seems fine: simple products linked to configurable product, all images linked to configurable product, product linked to category etc.

Then we navigate to the category, but we don't see any images. Then we look in backoffice again, and product images of the configurable product have been removed!

After some investigation, we can reproduce the issue when we just upload images in the backoffice, manually, to the product. After doing so and refreshing the backoffice page, the image(s) are displayed correctly .. but after reindexing, the image is removed again.

Any thoughts?


texts: How to install TCPDF lib without composer in Magento 2?

texts:
Followed these steps:

Download TCPDF from https://github.com/tecnickcom/tcpdf
Change the name of the file root directory after extraction to TCPDF
Inside this directory, there is a tcpdf.php file, change the name to TCPDF
Open the file and change the class name from tcpdf to TCPDF_TCPDF
Copy the files into your Magento “lib” folder in the root Magento installation directory. i.e lib/TCPDF

And can be called this class by $tcpdf = new TCPDF_TCPDF() from anywhere in Magento. Here is Source

But this is not working!!
Getting Error like: Fatal error:

  Class 'Vendor\Module\Controller\Adminhtml\Generatepdf\TCPDF_TCPDF' not
  found in
  E:\Xampp\htdocs\magento\app\code\Vendor\Module\Controller\Adminhtml\Generatepdf\CreatePdf.php
  on line 35

Installation with composer works fine and I get PDF generated! But I have to send this complete package and cannot ask client to run composer command for this module.I think autoloader is not getting aware of this library. How can I integrate it?

This is my class:

<?php

namespace Vendor\Module\Controller\Adminhtml\Generatepdf;

use Magento\Backend\App\Action\Context;
use Magento\Framework\App\Filesystem\DirectoryList;

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

protected $_dir;
protected $customerName;
protected $order;
public function __construct(
    Context $context,
    Order $order,
    DirectoryList $dir

)
{
    $this->order = $order;
    $this->_dir = $dir;

    parent::__construct($context);
}

public function execute() {

     $tcpdf = new TCPDF_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    //$tcpdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $tcpdf->SetCreator(PDF_CREATOR);

    $tcpdf->SetTitle('Title');

    $tcpdf->setPrintHeader(false);

    $tcpdf->setPrintFooter(false);

    // set default monospaced font

    $tcpdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

    // set margins

    $tcpdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

    $tcpdf->SetHeaderMargin(PDF_MARGIN_HEADER);

    $tcpdf->SetFooterMargin(PDF_MARGIN_FOOTER);

    // set auto page breaks

    $tcpdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

    // set image scale factor

    $tcpdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

    // set some language-dependent strings (optional)

    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {

        require_once(dirname(__FILE__) . '/lang/eng.php');

        $tcpdf->setLanguageArray($l);

    }

    // ---------------------------------------------------------

    // set default font subsetting mode

    $tcpdf->setFontSubsetting(true);

    //your htmls here

    $html=$this->getHtml();

    // set some language dependent data:

    $lg = Array();

    $lg['a_meta_charset'] = 'UTF-8';

    $tcpdf->setLanguageArray($lg);

    // set font

    //dejavusans & freesans For Indian Rupees symbol

    $tcpdf->SetFont('freesans', '', 12);

    // remove default header/footer

    //$tcpdf->setPrintHeader(false);

    $tcpdf->setPrintFooter(false);

    $tcpdf->AddPage();

    $tcpdf->writeHTML($html, true, false, true, false, '');

    $tcpdf->lastPage();

    //$tcpdf->Output('report_per_route.pdf', 'I');

    //$this->logger->debug('report_per_route');
    $baseurl = $this->getDirPath();
    $filename = $baseurl .'/export/'. 'Sample_pdf'. time().'.pdf';
    $tcpdf->Output($filename, 'I');
}

}
?>


texts: Getting EscapeHelper doesnt exist after magento upgrade to 2.2.6

texts:
Getting below error after upgrade to 2.2.6:
1 exception(s):
Exception #0 (ReflectionException): Class Magento\Framework\EscapeHelper does not exist

I have checked vendor/magento/framework folder and didn't found EscapeHelper file while same exist in previous versions like 2.1.7

Any idea on how we can fix the above exception? I have checked even magento core files are using EscapeHelper class in vendor\magento\module-customer\view\frontend\templates\form\login.phtml e.g. $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Password'))

Some of custom modules in my website are also using it same way.


texts: Why a partial refund puts the order in Confirmed status?

texts:
When an order is completely refunded, Magento sets its status to "Closed".
But when an order is partially refunded, the order status becomes "Confirmed".
I checked the source code and it appears as a deliberate logic decision.
Why an order should be "Confirmed" if partially refunded? What is the reason behind that decision?


texts: How to add product custom options on Checkout Page?

texts:
From my catalog page customer gets directly to onepage checkout.

My simple product got options which should affect price. This what I'm trying to do:
1. show options (the selection itself) on checkout page.
2. update total when any option is selected. (as its done on product view page)

This seems to be the solution using ajax, but i just cant figure out, how to set everything up.
Friends, can anyone explain the thing to beginner?


texts:
How can I test a page to make sure it is fully cached in EE1.13?

We are having some back and forth and the host is saying that the page may not even be cached.


texts:
Can you override the classes in \lib\internal\Magento\Framework and if so how?
I know how to use plugins/preferences to override the classes in  \code but these methods do no seem to work with the lib classes. Thanks.


texts: You do not have permission to access error in all the images in magento 1.9.3.4?

texts:
product images, Logo, etc any images which are using on the website, is not showing when I open images in new tab, error is showing
You don't have permission to access /media/product/afd/adc145.png on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request

I have checked the permission of all the folder which is related to images, all folders have 0777 permission.

Kindly help to resolve this issue


texts: How to hide/disable the checkbox of a free(price = 0) downloadable product?

texts:
How can I disable or hide a downloadable file checkbox(basically making it unselectable)with a price of 0? I'm create a music store, Im using a downloadable product type to create an album. I would like to make some songs not be able to be sold separately but show them as the part of the album.

Magento 1.7

Please see my screenshot, the last song shouldn't be selectable. Thanks
screenshot


texts: After logout, customer name still shows in header beside Sign In link

texts:
The login user session is expired but in the header, the customer username is showing as logged in.

Please help me to resolve this.


texts: How to export customer data as a xml file

texts:
Hello i am fairly new to the magento2 development.
I want some adivce on how I can perform the following:
when a new customer signs up for an account, the magento process should export a xml file with the customer data on a ftp server.


texts: No email templates getting loaded Magento 1.9.3.2

texts:
I am using Magento 1.9.3.2

When I go to System > Transaction Emails > Add new Template

In the Add new Template form No default templates are getting displayed

See the image for reference (Image 1.1),

How to solve the issue. Because in earlier versions the drop down box was showing all of the default email templates


texts:
I am using Ultimo theme for my Magento (1.9.2.1) website. How can I merge the Varnish ESI xml with the theme's current local.xml file?

For example for turpentine_esi.xml the header is

    <reference name="header">
        <action method="setEsiOptions">
            <params>
                <access>private</access>
                <flush_events>
                    <wishlist_item_save_after/>
                    <wishlist_item_delete_after/>
                    <sales_quote_save_after/>
                </flush_events>
            </params>
        </action>
    </reference>

and in the theme local.xml the header is

        <reference name="header">

        <!-- Mini cart -->
        <block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/mini.phtml" before="-">
            <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
            <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
            <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
            <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
                <label>Shopping Cart Sidebar Extra Actions</label>
            </block>
            <block type="cms/block" name="block_mini_cart_above_products">
                <action method="setBlockId"><block_id>block_mini_cart_above_products</block_id></action>
            </block>
        </block>

    </reference>


texts:
$listBusBlock = $listOfBuses->getLayout()->createBlock('Imonn\Bookings\Block\Buslist')->setTemplate('Imonn_Bookings::Busbooking/listOfBusses.phtml')->toHtml();
$this->getResponse()->setBody($listBusBlock);

in the above PHP code, I want to add $listBusBlock between the header and footer.

If I use $this->getResponse()->setBody($listBusBlock); the content is set to the entire body and the header and footer are gone.
what should I use instead of setBody so that the content can be added between the header and footer.


texts: Grouped products - link from associated product name in list to a detailed product page

texts:
I am trying to figure out the best way to set up my catalog, but I stumble upon something.
I have to say that I am new to Magento, very willing to learn and eager to start… but not sure how..

Anyway, my question is:

I added a grouped product, CIS-K6, see http://www.etk-mood.nl/shop/catalogus/inbouw/downlighters-led.html

And I added some simple products, cisk6-2700w and cisk6-2700w-nd as associated products.

But when I click the above link I see this:
http://www.etk-mood.nl/shop/catalogus/inbouw/downlighters-led/cis-k6-900.html
but what I need is to be able to click on the product name and go to a more detailed product page with a description.

Or perhaps skip the additional page and add a description, a little thumbnail and perhaps something else to the product name list on this page, and display the list under the photo, so I can add more columns.

Can you help?


texts: Understanding javascript code return componet.extend({}); in magento 2

texts:
I am new in magento 2 and requireJS
Can someone explain to me what "return componet.extend({}); " means when I am trying to add new JS module


texts: Magento Not upload image in admin custom tab form

texts:
In Created Custom tab in magento. Image not upload in editor. That display error like Uncaught ReferenceError: Mage is not defined

in Edit.php file

protected function _prepareLayout()
{
 // added this code
    if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
        $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
        $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
    }
}

in my Form

$configSettings = Mage::getSingleton('cms/wysiwyg_config')->getConfig(
                        array(
                        'add_widgets' => false,
                        'add_variables' => false,
                        'add_images' => true,
                        'files_browser_window_url'=>    $this->getBaseUrl().'admin/cms_wysiwyg_images/index/',
));


texts: Magento 2.2.0 - Display Recently Viewed Products block on Product Detail page

texts:
Approach One

Login to Admin panel
Click on Content -> Blocks
Create new product-detail block and edit then toggle show/hide
editor which will show insert widget option
Click on insert widget select "Recently Viewed Products" from
dropdown, add number of product to display (ex - 5)
Select template from dropdown then click on insert widget
Click on save Block

Although <p>{{widget type="Magento\Catalog\Block\Widget\RecentlyViewed" uiComponent="widget_recently_viewed" page_size="5" show_attributes="name,image,price" show_buttons="add_to_cart" template="product/widget/viewed/grid.phtml"}}</p> works in home-page block

Approach Two

For testing purpose added below code in vendor/magento/theme-frontend-luma/Magento_Catalog/layout/catalog_product_view

<block class="Magento\Reports\Block\Product\Widget\Viewed" after="-" name="recently_viewed" cacheable="false" template="Magento_Reports::widget/viewed/content/viewed_grid.phtml">
<action method="setPageSize">
    <argument name="page_size" xsi:type="number">5</argument>
</action>

Final code for catalog_product_view

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.main.title" destination="product.info.main" before="-"/>
        <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
        <move element="product.info.review" destination="product.info.main" before="product.info.price"/>

         <block class="Magento\Reports\Block\Product\Widget\Viewed" after="-" name="recently_viewed" cacheable="false" template="Magento_Reports::widget/viewed/content/viewed_grid.phtml">
            <action method="setPageSize">
                <argument name="page_size" xsi:type="number">5</argument>
            </action>
        </block>
    </body>
</page>

Did reindexing and cleared cache too but both the above approaches are not working.

How could I make this work and show recently viewed products block on
product detail page ?
Does Magento 2 supports local.xml just like earlier mage versions ?


texts: Unable to get order by increment id in observer

texts:
I use sales_order_place_after.

This is my observer file

public function execute(Observer $observer)
{
    $order = $observer->getEvent()->getOrder();
    echo $order->getIncrementId();
    $collection = $this->order->loadByIncrementId($order->getIncrementId());
    print_r($collection->getData());
}

Here I am getting increment ID but don't load order object by increment id.


texts: Wrong attribute set ID in general tab manage product

texts:
Where is a problem ?

    $installer = $this;
    $installer->startSetup();
    Mage::log("other_setup_addAttribute UPGRADE 0.0.2 -> 0.0.3 START");

    $setup = new Mage_Eav_Model_Entity_Setup('core_setup');

    $data=array(
        'type'=>'varchar',
        'input'=>'text',
        'sort_order'=> 7, //under visibility field
        'label'=>'Promotion %',
        'global'=>Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'required'=>'0',
        'comparable'=>'0',
        'searchable'=>'0',
        'is_configurable'=>'1',
        'user_defined'=>'1',
        'visible_on_front' => 1,
        'visible_in_advanced_search' => 0,
        'is_html_allowed_on_front' => 0,
        'unique'=> false
    );

    $setup->addAttribute('catalog_product','sd_promotion_label',$data);

    $attributeId= $setup->getAttribute('catalog_product','sd_promotion_label');

    $_attributeSetId = $setup->getAttributeSetId('catalog_product','Default');//default
    $_attributeGroupId = $setup->getAttributeGroup('catalog_product',$_attributeSetId,'General'); //General

    $setup->addAttributeToSet(
        'catalog_product', $_attributeSetId, $_attributeGroupId, $attributeId
    );

    Mage::log("other_setup_addAttribute 0.0.2 -> 0.0.3 END");
    $installer->endSetup();


texts:
I am using Magento 2.2.7 on a vps. I am using SM Market Theme. Due to Language problem of Theme support team, they are unable to understand the issue, thus I am not getting the solution.

In the admin section I have applied SM Market as my main theme. Due to cache or some unknown issue the home page theme is switched to SM Mobile Theme. To apply the main theme again, I have to run the php bin/magento c:c and c:f sometimes the indexer:reindex along with cache clean and flush command.

This is a frequent issue with the theme/store. The mobile theme has dummy content. And the home page looks like a mess.

I explained it many time to support but they always says, clear the cache and rebuild. I feel this is a temporary solution and required a dedicated person to check the home page and run the commands.

Please suggest a solution. All cron jobs are working fine and runs every 15 min. But cron job is not clearing any cache.

Home page after them page switch.

for original page you can refer www.rbhomoeoshop.com

Thanks,
Niraj


texts: Translate store language label in magento frontend

texts:
I wish to translate store language switcher label dropdown from english to simplified chinese.
PFA for thes same.


texts: how to properly do EcomDev PHPUnit file upload test with $_FILES?

texts:
I want to test file uploading function in my module, but i stuck with limitation of is_uploaded_file and move_uploaded_file over CLI.

Trying to emulate user uploading files actions by crafting custom $_FILES array:

class Company_Module_Test_Helper_CompanyHelperTests extends EcomDev_PHPUnit_Test_Case {

       public function uploadProductImagesTest() {
            ...
            $this->assertTrue(file_exists($testFile));
            $this->assertTrue(is_readable($testFile));
            $_FILES = array(
                    ...
            );

            $this->mockSession('customer/session');
            $this->customerSession($fixtureCustomerId);
            ...

but when i debug, i see that move_uploaded_file in Varien_File_Uploader->_moveFile() function just return false.

I found solution to use custom namespace and override move_uploaded_file and is_uploaded_file function but when i tried to add custom namespace in test class the test won't run:

namespace CustomTest;
class Company_Module_Test_Helper_CompanyHelperTests extends \EcomDev_PHPUnit_Test_Case {
  ...
  }

Need some advice in this case, maybe it is possible somehow ? Thanks


texts: Static Block Not showing up on left sidebar of CMS pages

texts:
1).
I am having problem in displaying Static Block on CMS pages Left Sidebar.

My Settings: CMS Page -> Design -> Layout -> 2 columns with left bar

Layout Update XML:

<reference name="left"> <block type="cms/block"
name="left.permanent.callout"> <action
method="setBlockId"><block_id>left_menu</block_id></action> </block>
</reference>

On CMS pages there is left block however nothing shows up (empty left bar)

Anyone who could help?

Thank you

PS: Yes I have created left_menu under static blocks


texts: Invoice Date to Shipment Transactional Email

texts:
I need your help please. I couldn't find answer from anywhere on how to insert an Invoice Date to Shipment transactional e-mail.

I tried to use the {{var invoice.created_at}}  but it gives me a blank result. i.e. http://prntscr.com/5cgoub

I can understand that the Invoice template doesn't have an Invoice date inserted, but I'm hoping that this is possible via a custom variable?

Thanks in advance for your help.


texts:
I managed by DOM, but has some interactions, I need capture the last change, in div.price-box to to send a post via ajax, if not shoot several ajax post.

Example:

$('.price-box').bind('DOMSubtreeModified', function() {
    alert('test');// display the alert from 5 ~ 9 times on the screen
});

The event .change in div.price-box or span.price does not work.

I would like to get an event that captures the change in price, or by my example only get the last interaction.


texts: It it possible to just take a mysql dump from Magento 2.2.9 community edition and import it into Magento enterprise cloud 2.3.3 and what are tools to use to do the job. Specifically to do the importing into enterprise cloud?


texts: Can anyone confirm? I heard that the RWD theme will no longer be an available option during install when Community version 2.0 is released. A rumor or fact?


texts: Make order list refresh in each 5 minute in magento admin

texts:
Is this possible in magento admin to make order list refresh if system is idle for 5 minute ??? my client want to make order list refresh in each 5 minute because he don't want to make page refresh whole page. he want automatically refresh the order list refresh on new order from there store .i try to fit here but here its not working can anyone can helpout

<meta http-equiv="refresh" content="5">
 setTimeout(function(){
 window.location.reload(1);
 }, 5000)


texts: Getting Error for asynchronous API call (v2.3) through postman

texts:
I get valid response when I try Synchronous API call.

E.g.

curl --location --request POST 'http://10.xx.xx.xxxx/rest/V1/customers' \
--header 'Authorization: Bearer jz62fwxwkdyyat8qeuxl1XXXXX97lpz' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer":
    {
        "email": "user@gmail.com",
        "firstname":"user",
        "lastname":"demo"
    },
    "password":"Welome@1234"
}'

But when I try the same payload with async call. I get below error

{
    "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5e26c6cc757f3"
}

I am not able to find Magento log file. Please let me know how can we resolve this?

And, why am I getting error for correct payload?


texts: Magento 2 - translating problem in JS templates

texts:
Is there a way to translate phrases defined in JS templates in Magento 2?
I have checked official translation structure overview and searched the net but can't seem to find proper solution.

For example: I wish to translate Qty string within minicart element. I have added the following translation to i18n/xx_XX.csv:

"Qty","Translation"

but doesn't take effect after refreshing. Other strings within the csv that are server side generated are translated fine.

I also have tried with deleting all cache files within /var and refreshing/flushing cache from admin.

Thanks for any suggestions.


texts: How to export salable quantity of all products

texts: Is there a way to export salable qty for all products in Magento 2.3?


texts:
I just updated to 2.3.0 and when i try to open any category page ->
  instead of filters i'm getting "Compare products" and "My wishlist" +
  . instead of product list getting message "We can't find products
  matching the selection."

How can i solve/investigate this question???


texts: Get customer billing address country short code (ISO Code)

texts: How can I get the country short code (ISO) of the billing address of a logged in customer. Can anyone help? Thanks!


texts: New security threat to Magento caused by it using jQuery-File-Upload?

texts:
Magento 2 uses the Blueimp jQuery File Upload Plugin v5.16.4 which has recently been identified at posing a security risk to web applications which use it.

Is this an issue for Magento and should this file be patched or replaced with a more recent version?

I see there is some PHP validation prohibiting uploading of certain file types (see exampled below) so perhaps it's not required?

Magento\Framework\File\Uploader::_validateFile()
Magento\Catalog\Model\ImageUploader::saveFileToTmpDir()
Magento\Cms\Model\Wysiwyg\Images\Storage::uploadFile()
Magento\ProductVideo\Controller\Adminhtml\Product\Gallery\RetrieveImage::validateRemoteFileExtensions()

Also, the blueimp patch for fixing this is for a file which Magento does not seem to use.


texts:
I'm implementing Prev/Next button on Product view page following Inchoo's Blog. It's working fine with Default Magento Theme but in My theme there is an issue with getting product position from Category.

In Product's view.phtml I've added code

<?php $_prev = $this->helper('retailon_productprevnext')->getPreviousProduct(); ?>
<?php $_next = $this->helper('retailon_productprevnext')->getNextProduct(); ?>
<?php if($_prev): ?><a class="product-prev" href="<?php echo $_prev;?>"><?php echo $this->__('< Previous')?><?php endif; ?>
<?php if($_next): ?><a class="product-next" href="<?php echo $_next;?>"><?php echo $this->__('Next >')?><?php endif; ?>

The Code for previous product in my Helper is like this:

     public function getPreviousProduct()
        {
            $prodId = Mage::registry('current_product')->getId();

            $catArray = Mage::registry('current_category');

            if($catArray){
var_dump($catArray);
                $catArray = $catArray->getProductsPosition();

var_dump($catArray);
/// Remaining code to return previous product

First dump is returning category array info, while the second one is not dumping any value.

Is there any other way using which I can get product position from category array instead of using   $catArray = $catArray->getProductsPosition(); ?


texts: Magento 2, google API, making custom sql query

texts:
Below sql statement finds the closest 20 locations within a radius of 25 kilometers to the -33, 151 coordinate.

SELECT id, ( 6371 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20;

I Wondering how to write the query in below?

protected function getConnection()
    {
        if (!$this->connection) {
            $this->connection = $this->_resource->getConnection('core_write');
        }
        return $this->connection;
    }
    public function getSearchQuery($lat,$lng)
    {
        $table=$this->_resource->getTableName('my_search_map_table');
        // sql query here?

    }


texts: The "Web Setup Wizzard" on Magento 2.2.5-dev redirects to the admin dashboard

texts:
I'm using Magento version 2.2.5-dev as a testing space for some things. Basically I have a company that wants to just have a magento instance to experiment with for some time before deciding on an eCommerce platform to move forward with.

The install went just fine. Everything is working as intended with no noticeable hiccups.

However when you attempt to navigate to the Web Setup Wizard I'm just redirected to the admin dashboard. I would like to use the Component Manager to install some modules/extensions they'd like to test from the marketplace.

There are two user account in the system. Both administrators, and they both get the same results. No errors are thrown, it just returns to the admin dashboard.

I've tried upgrading the system, rerunning composer, and flushing all the caches. Nothing seems to help.

Could anybody shine some light on why this is happening or how to fix it?


texts: Modify the Order Grid with Customer Information

texts:
I am trying to modify the order grid in which I require the customer information like active or deactivate which is my custom customer attribute so how can I display it in grid. I have also required to display it in order view template which I have already overridden it displayed it in that file.

  Note: I have modified the grid but not understanding how to display
  the customer `custom information. I have added the field in the grid
  remain is to populate it with customer data.


texts: Magento 2: How to call Widget programatically?

texts:
I have created widget

Type: CMS Static Block
Theme: My Theme
Display on: All Pages
Container: CMS Footer Links
Template: CMS Static Block Default Template
Widget Options: Block (My selected block)

It display my block content on Footer.

Above settings work fine in default Magento 2.1.4 CE, but it's not working on my Porto Theme.

So how to manually call my Widget in my Theme i think Theme's default.xml or in .phtml file or in My Custom Module?


texts:
I have Magento 2.1 shop with about 3,00,000 products, let me know the ways I can make indexing of shop fast

What should be the best server configuration


texts:
I have received below message from Authorize.net team.
 In October of this year, due to system updates, it will be possible to receive Authorize.Net IDs (Transaction ID, Batch ID, etc.) that are not in sequential order.

Currently, if you receive a Transaction ID of "1000," you could expect that the next Transaction ID would not be less than 1000. However, after the updates, it will be possible to receive a Transaction ID less than the one you previously received.

If your system has any functionality that expects Authorize.Net-generated IDs to be sequential, please update it immediately so that you will not see any disruptions to your solution.

Additionally, please make sure that your solution does not restrict any Authorize.Net ID field to 10 characters. If you are required to define a character limit when storing any of our IDs, the limit should be no less than 20 characters.

What does this message mean and how can I make sure if things will work fine in my Magento store after these changes and what changes do I need to make to all go smooth?


texts: Magento 1.9: Getting all products and a corresponding attribute using SQL queries

texts:
I want to get all simple products and in addition, I want to get an attribute called title_name for those products. The attribute_id (from eav_attribute) of the attribute is 450.

This is what I got so far:

SELECT * FROM catalog_product_entity WHERE type_id = 'simple';

Now I need the join with the attribute and this is where I am struggling. How can I do that?

Magento 1.9


texts: Get shipping tax percentage from order object

texts: How can I get the shipping tax percentage from order object. I can see the shipping rate column in sales_order table but I couldn't find the percentage of shipping tax. Please help me? Thanks in advance.


texts: Magento-2 How to get custom product collection in catalog search result based on particular category

texts:
I am working on custom module for catalog access. It requires only logged in customer to access the assigned category products.

Right now in catalog search result, product collection displays all the category products, but I need to display only selected category products.

See below Example

Suppose customer A has access to only categories Men > Tops > Tshirts. So, he will only see Men > Tops > Tshirts products in catalog search in magento 2. In search results only assigned categories products should display and not any other category products.


texts: Magento layered navigation, select multiple filters via URL

texts:
we use layered navigation. And we also used to send filter links in newsletters Like URL/?shirt_size=8 ....

But recently we have come across the need to filter both on shirt_size=8 and shirt_size=12 in one link .....

Question: can this be done in Magento. And if so how?

ps. This did not work
?shirt_size=8,12
?shirt_size=6&shirt_size=8
?shirt_size=6;8


texts:
I created a bulk product "ProductBK".

This product is based on 10 items of a simple product "ProductS1".

ProductS1 has a normal price if 4.99 euro and a tier price with Number=10 and Price=4.00.

If I open the single product view of ProductBK I see what I expected: ProductBK costs 40 euros instead of 49.90 euros.

The problem is in each list of products (catalog, splash pages, search pages, feed xml, etc.); in these pages I see the price based on the normal price of ProductS1, therefore 49,90 euro.

In the product page, the correct prices is shown thanks to some javascript libraries:
- /js/varien/product.js
- skin/frontend/base/default/js/bundle.js

Do you know if there is a way to get the expected price for bundle product? (or at least, the minimum price, if there are more products involved with bulk product).

I know that the query could become slower, but I definitely need of this...

Thank you in advance


texts: Two functions on submit button Magento 2

texts:
i want my vendor registration form to show a video popup when click on submit button.
<button type="submit" id="save" class="action submit primary" onclick="submit"title="Save"><?php echo __('Save'); ?></button>
can anyone kindly and please help me fast on this?


texts: Magento2: How can set duplicate product URL?

texts:
I want to create each product with duplicate url like

  example.com/custom.

I have tried below things.
I am creating each product with url of custom-productId then it is coming like

  example.com/custom-189

but I want in that way

  example.com/custom

without 404 page.

Can Anyone help me for that.


texts:
I m trying to get all stores of a block cms in an adminhtml page.
But something is wrong :(
Here is my code :

    class Upecom_Brandhub_Block_Adminhtml_Grid_Grid
        extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface
    {

        /**
         * Get tab label
         *
         * @return string
         */
        public function getTabLabel()
        {
            return Mage::helper('Upecom_Brandhub')->__('Blocks');
        }

        /**
         * Get tab title
         *
         * @return string
         */
        public function getTabTitle()
        {
            return Mage::helper('Upecom_Brandhub')->__('Blocks');
        }

        /**
         * Check if tab can be displayed
         *
         * @return boolean
         */
        public function canShowTab()
        {
            return true;
        }

        /**
         * Check if tab is hidden
         *
         * @return boolean
         */
        public function isHidden()
        {
            return false;
        }

        public function __construct()
        {
            parent::__construct();
            $this->setId('myTabGridBlocks');
            $this->setUseAjax(false);
            $this->setDefaultSort('entity_id');
            $this->setDefaultDir('DESC');
            $this->setEmptyText(Mage::helper('Upecom_Brandhub')->__('No records found!'));
        }
          protected function _prepareCollection()
            {
        $collection = Mage::getModel('cms/block')->getCollection()
                        ->addFieldToFilter("brand_id", 500)
                        ->addFieldToFilter("type_block", 6);
         $this->setCollection($collection);

                return parent::_prepareCollection();
            }
          protected function _prepareColumns()
            {
 $this->addColumn(
            'identifier',
            array(
                'header' => Mage::helper('Upecom_Brandhub')->__('Identifier'),
                'width' => '200px',
                'index' => 'identifier',
            )
        );
          if (!Mage::app()->isSingleStoreMode()) {
                    $this->addColumn('store_id', array(
                        'header'        => Mage::helper('cms')->__('Store View'),
                        'index'         => 'store_id',
                        'type'          => 'store',
                        'store_all'     => true,
                        'store_view'    => true,
                        'sortable'      => false,
                        'filter_condition_callback'
                        => array($this, '_filterStoreCondition'),
                    ));
                }
        }
        }

It return me all the time nothing in the store columns (but i have everything else )


texts: How to update configurable associated products programmatically?

texts:
I'm trying to update configurable associated products. When I save my product I get this error:

Integrity constraint violation: 1062 Duplicate entry '183-137' for key 'UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_ID'
, query was: INSERT INTO `catalog_product_super_attribute` (`product_id`, `attribute_id`) VALUES (?,
 ?)<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

How can I update the configurable associated products?


texts: magento 1.9.2.0 is not showing websecure url or baseurl

texts: Magento 1.9.2.0 is not showing web-secure-url or baseurl even any path for %http:// % . Then, how I can move Magento website from local server to live server.


texts: Are product attribute names accessible from Magento API?

texts:
My goal is to pull this information as a guest but I have tried as both an admin and a guest. My results look like this:

URL: {magento_base_url}/m/api/rest/products/category/12

 <magento_api>
  <entity_id>10011</entity_id>
    <type_id>grouped</type_id>
    <sku>ITEM-SKU</sku>
    <attribute_code>attributeid</attribute_code>
    <attribute_code>attributeid</attribute_code>
    <attribute_code>attributeid</attribute_code>
    <attribute_code>attributeid</attribute_code>
    <attribute_code>attributeid</attribute_code>
...
</magento_api>

Of course, attribute_code is the actual product attribute code like  and attribute_id is a numerical value.

Edit for Clarification

In my example <attribute_code>attributeid</attribute_code> represents <description>80</description> or 2`.

What I am hoping for is let's say my attribute_code = "multiple_select_for_product_features" and attributeid=20 and label="Product Features" and selected value="Resistent to water". How would I pull the label and value?


texts:
we are using 1.9.0 version

i am trying to install the security patches through ssh

  root@KidsDial:/var/www/html/# sh PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh
  PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 14:
  PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 127: not found

  PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 14:
  PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 127: not found

  PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 25:
  PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 0: not found

  Checking if patch can be applied/reverted successfully...
  Patch was applied/reverted successfully.

at the end, i am getting " Patch was applied/reverted successfully."

but above i am getting 3 lines displaying "not found", it means is patched updated succesfully..?...

when we checked here http://magento.com/security-patch, we are getting the sites is safe


texts: Magento Connect Manager Not working - Returns Error Page

texts:
How can I solve magento connect manager not working at my back end, its return 404 Error. I have checked system - > configuration -> advance : Its fine, And also tried magento_cleanup_file.

How can I clear this error.


texts:
I get this error when trying to register an account : "No such entity with customerId = ","1"
Please help to resolve this issue. Thanks in Advance.


texts:
I need to remove index.php from the URL requests to the API. Currently API calls only work as the following...

/index.php/api/v2_soap/?wsdl

I need it to load as

/api/v2_soap/?wsdl

Can any one give some idea.

Sadly I am not able to change where the script looks as it is coming from an integration on the Royal Mail website.


texts:
How to add custom tab in product Edit Page in magento2?

I'm  refer https://webkul.com/blog/add-tab-product-page-magento-admin/

But , i can't see tab in product edit page...

If anyone knows please explain me

Thanks.


texts: Showing all categories down the side of home page

texts:
Im using code that i found on a magento wiki page about showing All categories (http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/getting_and_using_categories_and_subcategories).

However when i apply this to a page it just shows the words "All categories" which is a link to my categories page. But i want it to display all of my categories (the sub categories of All categories). I have put the code below

<?php
/* Get the categories that are active for the store */
$_main_categories=$this->getStoreCategories();

/* Get the current category the user is in */
$_current_category=$this->getCurrentCategory();

/* Get the current category path */
$_categorypath = $this->getCurrentCategoryPath();
?>

<?php
if ($_main_categories):
    /* This bit cycles through the categories - setting the next one to current */
    foreach ($_main_categories as $_main_category):
      if($_main_category->getIsActive()):
           $cur_category=Mage::getModel('catalog/category')->load($_main_category->getId());
           $layer = Mage::getSingleton('catalog/layer');
           $layer->setCurrentCategory($cur_category);

/* Write the main categories */
?>

<a href="<?php echo $this->getCurrentCategory()->getUrl()?>"><?php echo $this->getCurrentCategory()->getName();?>

<?php

/* Check the category variable loop against the current category path if it is - print sub categories */
if (in_array($this->getCurrentCategory()->getId(), $_categorypath)): ?>
<?php $_maincategorylisting=$this->getCurrentCategory()?>
<?php $_categories=$this->getCurrentChildCategories()?>
<?php if($_categories->count()):?>

<? foreach ($_categories as $_category):?>
   <? if($_category->getIsActive()):
           $cur_subcategory=Mage::getModel('catalog/category')->load($_category->getId());
           $layer = Mage::getSingleton('catalog/layer');
           $layer->setCurrentCategory($cur_subcategory);

?>

<a href="<?php echo $this->getCategoryUrl($_category)?>"> <?php echo $_category->getName()?>

    <? endif;?>
<?endforeach?>

<?php /* This resets the category back to the original pages category
****     If this is not done, subsequent calls on the same page will use the last category
****    in the foreach loop
*/   ?>

<?endif;?>

<?endif;?>

<?php $layer->setCurrentCategory($_current_category); ?>

<?php
endif;
endforeach;
else:
?>

$_main_categories array was empty.

This might be because you are referencing this phtml file with a wrong type attribute. You should use <block type="catalog/navigation" ... /> !

<?php end;?>

What would i have to change to get to to show the sub categories of All categories??

Thanks in advance


texts: Stop "Please match the requested format: Qty." from displaying when updating a decimal quantity field in shopping cart

texts:
Google searches for both "Magento please match the requested format: Qty" and "magento decimal quantites not updating in cart" have turned up nothing useful me.

Hi, I'm using CE 1.9.2.0 w/ patch 6482 installed. My store is early in development and has no themes or extensions whatsoever. I have items in my store with the following inventory attribute : value pairs:

Minimum Qty Allowed in Shopping Cart : .25

Qty Uses Decimals : Yes

Enable Qty Increments : Yes

Qty Increments : .25

I am able to add quantities to the cart if they are a multiple of .25 right from the product detail page. Magento does complain in the form of highlighting the quantity field in red, but the quantity is added to the cart nonetheless. If I do nothing else, I can proceed to checkout at this point without issue.

However, from the shopping cart, I cannot change an integer quantity to a decimal, nor can I change an integer quantity to a different integer quantity while another product's quantity is a decimal, nor can I change a decimal quantity to a different decimal quantity. I can change a decimal quantity to an integer quantity, whether or not other decimal quantities are in the cart.

Magento displays a "Please match the requested format: Qty." message below the quantity field when these violations are detected.

How can I get the form validation for the quantity field to behave as expected?


texts: Extension attribute error "Call to undefined method Magento\Catalog\Api\Data\ProductExtension: : setDummyAttribute() on ProductExtension"

texts:
Error :
Uncaught Error: Call to undefined method  Magento\Catalog\Api\Data\ProductExtension: : setDummyAttribute() on ProductExtension in MyCompany\MyModule\Plugin\DummyAttribute"

This is how I have implemented extension attribute.

I have used \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory in my function to fetch collection.
I have created custom data interface named CustomProductInterface to return my custom data.
Basically I am not returning \Magento\Catalog\Api\Data\ProductInterface and instead returning my CustomProductInterface.
Everything is working fine so far. Now I am creating extension attribute on CustomProductInterface. After adding this attribute, it starts throwing exception as "call to undefined method getDummyAttribute() on ProductExtension"

After debugging a lot, I found that CustomProductInterface is internally called as interface and corresponding object called is of Magento\Catalog\Api\Data\ProductExtension and not MyCompany\MyModule\Api\Data\CustomProductExtension.

<extension_attributes for="MyCompany\MyModule\Api\Data\CustomProductInterface">
    <attribute code="dummy_attributte" type="string"/>
</extension_attributes>

It works fine If I set extension_attribute for both the Interfaces as mentioned below:

<extension_attributes for="MyCompany\MyModule\Api\Data\CustomProductInterface">
    <attribute code="dummy_attributte" type="string"/>
</extension_attributes>

<extension_attributes for="Magento\Catalog\Api\Data\ProductInterface">
    <attribute code="dummy_attributte" type="string"/>
</extension_attributes>

My requirement is such that I have to use product collection with joins on my custom tables and display required data using my custom interface.

So I have found the solution, but it seems improper to me and I am looking for explanation of above case.

According to my research, it seems like we cannot use extension attribute on custom collection.


texts: How do I render country name from country_id in Adminhtml grids?

texts: Is there a built-in column renderer for that, or should I build one myself?


texts: Change order of columns in "Manage Products" page grid

texts:
I would like to switch the column order in the Manage Products admin grid.

Say I want to move the SKU column before the Name column. How would I go about that without installing any extensions?


texts: How to Override the ProductRepository class

texts:
I want to override the ProductRepository.php class need to do some changes in the Save function

File Path : vendor/magento/module-catalog/Model/ProductRepository.php

Fucntion Name: Save

How can I Override the ProductRepository.php class which is implement by the  \Magento\Catalog\Api\ProductRepositoryInterface class

Our magento2 version is: 2.1.7


texts: Magento 2: 403 error after issuing setup:upgrade command

texts:
I have set 777 permissions for pub/ and var/ directories.
I have run php bin/magento setup:upgrade.
A 403 error is displayed when accessing any page on the website with the following message:

  Failed to load resource: the server responded with a status of 403 (Forbidden)


texts:
magento1 admin panel new product add then error show 500 http error.

SO GIVE ME SOLUTION PLEASE.

Mehul Kanjariya


texts: magento grid search is not triggered if both search term and filters unchanged

texts:
In magento grid setting, by default the search request call (ajax call) is not triggered if search term and filter remain unchanged since last search.
How can I force it to send out search request every time I click the fulltext magnifying-glass icon or the Ａpply Filters button under expanded filter panel?


texts: Checkout page is not working for store in Magento 2.2.0

texts:
I have created a store for my Website, that works fine but checkout page at store is not working while it is working fine at main website. If we checkout a product through store only loader is running and page is not getting loaded.
Help will be appreciated.


texts: How to get the upsell product Collection in list page in magento 2

texts:
I have created a module to show upsell products in List page.
In List page, I have put one icon on each product, while clicking that icon, It would need to show upsell products list which is associated with the current product.
So Please provide me a solution to get the upsell products list Collection, for a particular product in list page.
Thanks in advance


texts: Unable to access Magento Due To ERR_EMPTY_RESPONSE

texts:
Magento was working fine but then on trying to access http://80.85.85.79/berguard_stationery
I get an error:
This page isn’t working
80.85.85.79 didn’t send any data. ERR_EMPTY_RESPONSE

I have three magento installations on the same server and visiting the urls for all of them brings up the same error.

From the research I have done, I came across this but it wasn't helpful on how to solve the error.

This error is not logged in /var/log/apache2/error.log

Below is my virtualhost file:

<VirtualHost *:80>
    ServerAdmin admin@shop.com
    DocumentRoot /var/www/html
    ServerName shop.com
    ServerAlias shop.com

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I have edited my virtualhost file to:

<Directory /var/www/html/magento2/magento2-2.3>
    Require all granted
</Directory>
<VirtualHost *:80>
    ServerAdmin admin@shop.com
    DocumentRoot /var/www/html
    ServerName shop.com
    ServerAlias shop.com

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/magento2/magento2-2.3>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
</VirtualHost>

I have edited my virtualhost file to:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        #ServerName shop.com
        #ServerAlias shop.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/magento2/magento2-2.3/pub

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
        <Directory "/var/www/html">
                AllowOverride all
        </Directory>
</VirtualHost>

I still have the error showing up.

How do I go about solving this error?


texts: How to get stock quantity of child product from configurable product in Magento 1.9

texts:
I need help with my custom stock status.
That's what I have today.
My problem is that this shows only the qty of the parent product not the qty of the actually in use child product.
I need the qty of the actually in use child product.
My english is not the best.
So I hope everyone understand what I mean / know what I want to build.
I sell shoes and have a lot of sizes for one shoe. So one shoe is a configurable product and have 10 options (simple products) that are the sizes to select.
When I use my own code I can only get and use the quantity of the one configurable product (shoe) and not from the selected size (simple product).Have anyone a idea how I can get and use the quantity of the selected product?

<?php if ($qtyStock = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()>0):{?>

        <?php echo $this->helper('catalog')->__('Availability:') ?>
        <?php echo $this->helper('catalog')->__('In stock') ?>

Delivery Time:

Delivery in 3 Days

     <?php } else: { ?>

        <?php echo $this->helper('catalog')->__('Availability:') ?>
        <?php echo $this->helper('catalog')->__('Out of stock') ?>

Delivery Time:

Delivery in 8 Days.

                <?php } endif; ?>


texts: Magento Error: Item (Mage_Sales_Model_Order) with the same id "1457" already exist

texts:
$items = Mage::getModel('sales/order')->getCollection();
          $items->getSelect()->joinLeft('sales_flat_order_item', 'main_table.entity_id = sales_flat_order_item.order_id', array('name'));
           $items->addAttributeToFilter('main_table.created_at', array('like'  => $lastweek));
        $items->addAttributeToFilter('status', $status);
           $items->addAttributeToFilter('name', array('like' => $searchTerm));

        foreach($items as $item)
    {
//get customer email and name
}

This is my code. I tried using distinct and group but i get blank result for those. When i dont, i get this error. I know the issue is because of duplicate order ids. How can i resolve this?


texts:
I am new to magento stack, I have a requirement of deploying a magento based e-commerce in AWS.
This site is expected to have 100,000 hits in first couple of months and within an year expected to get about a million hits/month.
Initially i thought of going with a EC2 t3.medium (2Core&4GB) for WEBSERVER and RDS db.t3.small(MySQL) for Database. So far it is fine.
My Query is, in magento docs it is specified that we need to have VARNISH and REDIS for getting better performance.
If i install varnish + Apache httpd + Redis in my EC2 will it be a overkill in t3.medium?
Say If  i have a compute optimized instance c5.xlarge(4Core 10ECU 8GB), Is is fine to load these 3 in one monolithic server?
More over for better product searching, in docs it is specified to use ElastiSearch how we can configure this?
Please suggest me how i can architect this.