texts: How to know the existing Sort Order of Admin menus?

texts:
I started with creating a custom module.
When creating the ADMIN part for that module, I came across <sort_order> tag, which is responsible for placing the menu (I guess).
Coming to my question here is how to know the sort order of existing Menus, so that I can place my menu in first or last position or may be in middle position. Is their any way to determine the existing Menus ordering?

Below is my code adminhtml.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <menu>
        <helloworld translate="title" module="helloworld">
            <title>HelloWorld Admin</title>
            <sort_order>95</sort_order> <!-- I have just given some random number, and it placed my menu at last position :) -->
            <children>
                <helloworld translate="title" module="helloworld">
                    <title>SubMenu 1</title>
                    <sort_order>1</sort_order>
                    <action>perficient/helloworld/index/test</action>
                </helloworld>
            </children>
        </helloworld>
    </menu>
</config>


texts: Get product custom option in admin panel order detail page

texts:
I want to get the product's custom option in admin panel along with order, it should work for the configurable products as well.

Also please let me know which files to change.


texts: Cannot sorting joined column in Magento Grid

texts:
I have joined 2 columns to customer grid, I can make them filterable but I don't know how to make them sortable.
Here is my _prepareCollection function:

protected function _prepareCollection()
  {
    $collection = Mage::getResourceModel('customer/customer_collection')
      ->addNameToSelect()
      ->addAttributeToSelect('email')
      ->addAttributeToSelect('created_at')
      ->addAttributeToSelect('group_id');
    $collection->addSalesInfoPerCustomer();
    $this->setCollection($collection);
    return parent::_prepareCollection();
  }

My joined function:

public function addSalesInfoPerCustomer() {
    $this->getSelect()
      ->joinLeft(
        array('s' => new Zend_Db_Expr('(SELECT sum(o.base_grand_total) total_sales, COUNT(*) as order_count, customer_id'
          . ' FROM ' . Mage::getSingleton('core/resource')->getTableName('sales/order') . ' AS o'
          . ' GROUP BY customer_id)')),
        "s.customer_id = e.entity_id",
        array('total_sales', 'order_count')
      );
  }

Added Column:

$this->addColumn('order_count', array(
      'header' => Mage::helper('customer')->__('Total Orders'),
      'index' => 'order_count',
      'filter_index' => 'pages_with_number_of_views.order_count',
      'filter_condition_callback' => array($this, '_roleFilter'),
    ));

    $this->addColumn('total_sales', array(
      'header' => Mage::helper('sales')->__('Total Sales'),
      'index' => 'total_sales',
      'type' => 'price',
      'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),
      'filter_condition_callback' => array($this, '_roleFilterTotalSales'),
    ));

Can anyone help me please ?


texts: Magento version 2.1.0 : Issue with static content deploy as not generating the product images

texts:
I am running static content deployment command but unfortunately its not generating the media in pub folder
Magento version 2.1.0


texts: Magento 2.2.7: Error cleaning cache by mode matchingTag

texts:
When i am trying to add the robot.txt entry via admin, getting the following error

Magento 2.2.7 Something went wrong while saving this configuration: Error cleaning cache by mode matchingTag: read error on connection.

Can anyone help me out on this.


texts: What are the cons if we allow cron.php run from browser?

texts: What are the cons if we allow browsing of cron.php?


texts:
Im trying to send the sales order email with three attached PDF files.
At first i need to attach the terms/conditions for b2b and b2c but the cancellation policy also.

I searched a while and just found the "FOOMAN EMAIL ATTACHMENTS" where i cant attach more than just one file.

Maybe someone got a similar problem and could tell me how to realize this?


texts: How to get the value of custom field checkout address in Carrier Model Magento 2

texts:
I followed the tutorial here to make a custom field in address form checkout:

<?php
$customAttributeCode = 'custom_field';
$customField = [
    'component' => 'Magento_Ui/js/form/element/abstract',
    'config' => [
        // customScope is used to group elements within a single form (e.g. they can be validated separately)
        'customScope' => 'shippingAddress.custom_attributes',
        'customEntry' => null,
        'template' => 'ui/form/field',
        'elementTmpl' => 'ui/form/element/input',
        'tooltip' => [
            'description' => 'this is what the field is for',
        ],
    ],
    'dataScope' => 'shippingAddress.custom_attributes' . '.' . $customAttributeCode,
    'label' => 'Custom Attribute',
    'provider' => 'checkoutProvider',
    'sortOrder' => 0,
    'validation' => [
       'required-entry' => true
    ],
    'options' => [],
    'filterBy' => null,
    'customEntry' => null,
    'visible' => true,
];

$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children'][$customAttributeCode] = $customField;

the above code is showing in in checkout, but when the validation triggered to calculate the shipping method price in Model/Carrier.php that i made following  tutorial in here, i'm confused how to get the value from the custom field, here's the Model/Carrier.php :

<?php
namespace Inchoo\Shipping\Model\Carrier;

use Magento\Quote\Model\Quote\Address\RateRequest;
use Magento\Shipping\Model\Rate\Result;

class Example extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements
    \Magento\Shipping\Model\Carrier\CarrierInterface
{
    /**
     * @var string
     */
    protected $_code = 'example';

    /**
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory
     * @param \Psr\Log\LoggerInterface $logger
     * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory
     * @param \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory,
        \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory,
        array $data = []
    ) {
        $this->_rateResultFactory = $rateResultFactory;
        $this->_rateMethodFactory = $rateMethodFactory;
        parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
    }

    /**
     * @return array
     */
    public function getAllowedMethods()
    {
        return ['example' => $this->getConfigData('name')];
    }

    /**
     * @param RateRequest $request
     * @return bool|Result
     */
    public function collectRates(RateRequest $request)
    {
        if (!$this->getConfigFlag('active')) {
            return false;
        }

        /** @var \Magento\Shipping\Model\Rate\Result $result */
        $result = $this->_rateResultFactory->create();

        /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */
        $method = $this->_rateMethodFactory->create();

        $method->setCarrier('example');
        $method->setCarrierTitle($this->getConfigData('title'));

        $method->setMethod('example');
        $method->setMethodTitle($this->getConfigData('name'));

        /*you can fetch shipping price from different sources over some APIs, we used price from config.xml - xml node price*/
        $amount = $this->getConfigData('price');

        $method->setPrice($amount);
        $method->setCost($amount);

        $result->append($method);

        return $result;
    }
}


texts:
I having an issue with a css file. I remove some css code from a class and it does not change after refresh in the browser.
I clear the var cache folder multiple times. I removed all of my cache from the beginning of time from my browser. I clear the cache from admin panel. I tried on multiple browser. But nothing changed. If I rename/remove the css file and i refresh the page it ignores the content of my file.
This is what i did wih my class:

.topbar .logo {
        /*margin-left: -25px;
        display: block;
        width: 230px;
        height: 230px;*/
}

So any ideas, What I should try more, on enterprise ?thx


texts: Magento 2: How to get resize image for Custom Module?

texts:
I'm using Magento 2 CE Version 2.1.0

I have Custom Module with Image Field. When it's uploaded, i want different size images as for product we have
Thumbnail Image, List Image & Product Detail Page Image.

Able to upload 1 image without resize.

I'm using below code for resizing image, but it's giving product image URL. Not my custom module.

\app\code\Custom\Module\Block\MyPosts\Edit.php

public function getImage($posts, $image) {
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $_imagehelper = $objectManager->get('Magento\Catalog\Helper\Image');
    echo $postImage = $_imagehelper->init($posts, $image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(400)->getUrl();
    exit;
}

It gives below URL http://localhost/magento2/pub/static/frontend/Magento/luma/en_US/Magento_Catalog/images/product/placeholder/.jpg

My image is stored here: \magento2\pub\media\custom_module\posts\image.

How can i get resize image with this path & how can i save/retrieve different size image?


texts: Add Custom Attribute in Customer Account admin side and its value from another Module?

texts:
I want to add a multiselect dropdown attribute to Customer module in Customer Account Tab (Admin Panel) and Want its value from my another module.

Please let me suggest how can I achieve this.

I am using Magento 1.9.2.4


texts: How to setup google enhanced ecommerce on magento 1.9

texts:
How to setup google enhanced ecommerce web tracking code on magento 1.9

reference:
https://developers.google.com/tag-manager/enhanced-ecommerce


texts: Magento 2 How to make changes to Bundle product edit detail page?

texts:
I want to make some changes to bundle product detail page.

I found a module in my theme which has this Reference Block for bundle addtocart .

Magento_Bundle/layout/default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customize.button">
            <action method="setTemplate">
             <argument name="template" xsi:type="string">Magento_Bundle::catalog/product/view/customize.phtml</argument>
           </action>
        </referenceBlock>
        <referenceBlock name="product.info.addtocart.bundle">
            <action method="setTemplate">
             <argument name="template" xsi:type="string">Magento_Bundle::catalog/product/view/bundleaddtocart.phtml</argument>
           </action>
        </referenceBlock>
    </body>
</page>

How can I do it for Edit bundle which comes from edit action on mini cart for bundle product.


texts:
This is my  default_head_blocks.xml file code

<css src="css/source/_style-l.css" />
    <css src="css/source/styles-m.css" />
    <css src="css/source/styles-l.css" media="screen and (min-width: 768px)"/>
    <css src="css/source/print.css" media="print" />
</head>

Is an application set to developer mode and all the CSS file incorrect location?


texts:
How to add grunt-notify module to Magento 2 Grunt config.
Reference: https://github.com/dylang/grunt-notify

Thanks.


texts:
I'm currently trying to move the category description to below the product grid.

Below is the catalog_category_view.xml layout:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.main.title" destination="content" before="category.products" />
        <move element="category.description" destination="content" before="category.products" />
        <move element="category.image" destination="page.top" before="breadcrumbs" />
        <move element="category.cms" destination="page.top" before="breadcrumbs" />
        <referenceBlock name="catalog.compare.sidebar" remove="true"/>
        <referenceContainer name="sidebar.additional" remove="true" />
        <referenceContainer name="page.top">
            <block class="Magento\Cms\Block\Block" name="catagory-and-product-page-usp-bar" before="breadcrumbs">
                <arguments>
                    <argument name="block_id" xsi:type="string">catagory-and-product-page-usp-bar</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="footer">
            <block class="Magento\Cms\Block\Block" name="usp-bar" before="-">
                <arguments>
                    <argument name="block_id" xsi:type="string">usp-bar</argument>
                </arguments>
            </block>
        </referenceContainer>
    </body>
</page>

I have tried updating the XML Layout on the category with the following code but nothing seems to change, Anyone got any ideas?

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="category.description" destination="content" after="category.products" />
    </body>
</page>

Code Found:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.main.title" destination="content" before="category.products" />
        <move element="category.description" destination="content" before="category.products" />
        <move element="category.image" destination="page.top" before="breadcrumbs" />
        <move element="category.cms" destination="page.top" before="breadcrumbs" />
        <referenceBlock name="catalog.compare.sidebar" remove="true"/>
        <referenceContainer name="sidebar.additional" remove="true" />
        <referenceContainer name="page.top">
            <block class="Magento\Cms\Block\Block" name="catagory-and-product-page-usp-bar" before="breadcrumbs">
                <arguments>
                    <argument name="block_id" xsi:type="string">catagory-and-product-page-usp-bar</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="footer">
            <block class="Magento\Cms\Block\Block" name="usp-bar" before="-">
                <arguments>
                    <argument name="block_id" xsi:type="string">usp-bar</argument>
                </arguments>
            </block>
        </referenceContainer>
    </body>
</page>


texts: Magento 2 : Add Product Attribute Programmatically

texts: How to create Magento 2 Product Attribute Programmatically with type : Text Area.


texts: How to collaborate with a translation pakage for the control panel?

texts: I'd like to know how could I translate the control panel for Magento 2.x, I've seen that the packages are created, but empty, how could I collaborate in order to translate it?


texts: Change theme dynamically from frontend doesn't update xml layout

texts:
So i have a dropdown i created that fires a request to change a theme by saving the selected theme in the current session.  I set up an event/observer that changes the theme based on that session variable:

    <events>
        <controller_action_layout_generate_blocks_before>
            <observers>
                <themesplayground>
                    <type>singleton</type>
                    <class>Rusman_ThemesPlayground_Model_Observer</class>
                    <method>switchTheme</method>
                </themesplayground>
            </observers>
        </controller_action_layout_generate_blocks_before>
    </events>

And here is observer method:

public function switchTheme($observer){
    Mage::log(__METHOD__,null,null,true);

    if( Mage::getSingleton('core/session')->getCurrentTheme() ){
        Mage::log(Mage::getSingleton('core/session')->getCurrentTheme(),null,null,true);

        foreach (array('layout', 'template', 'skin', 'locale') as $type) {
            Mage::getDesign()->setTheme($type, Mage::getSingleton('core/session')->getCurrentTheme());
        }

    }
}

The set up above works for the template files just fine, but the xml layout files(i only have local.xml for now) for the new theme don't seem to be getting loaded in. Is there another event i should observing?  Or am i forgetting to update something?


texts: Extract a module from a magento installation to a zip?

texts:
Is there tools/software can extract a module installed in a magento (includes DB stables, js script, layout, phtml, xml) back to a zip file?

Does this tool exists?


texts:
I am trying to change the colours from the standard Magento 2 blank theme via the _theme.less file. I currently have the following file structure /public_html/app/design/frontend/GladiatorFitness/Gladiator

- registration.php
- theme.xml
- web
-- css
--- source
---- _theme.less
---- _typography.less
-- fonts
-- images

In my _themes.less I have added the following the following, and I have attempted to clear caches, and deploy assets. Nothing seems to make a difference.

//  Primary button
@button-primary__background: @color-orange-red1;
@button-primary__border: 1px solid @color-orange-red2;
@button-primary__color: @color-white;
@button-primary__hover__background: darken(@color-orange-red1, 5%);
@button-primary__hover__border: 1px solid @color-orange-red2;
@button-primary__hover__color: @color-white;


texts: Magento 2 Add Category Tree Renderer Input With Modal Button

texts:
I am trying to place the category input for my custom form using uicomponent form.

I am able to create dropdown but how I can create the button and open a new modal from it?

Can I create a button using uicomponent and open a modal from it.
I want a button instead of new category I want to add select products button and want to add show list of products from selected categories in grid.

Here is the xml for creating the category input

<field name="parent">
    <argument name="data" xsi:type="array">
    <item name="options" xsi:type="object">Magento\Catalog\Ui\Component\Product\Form\Categories\Options</item>
     <item name="config" xsi:type="array">
          <item name="label" xsi:type="string" translate="true">Parent Category</item>
          <item name="componentType" xsi:type="string">field</item>
          <item name="formElement" xsi:type="string">select</item>
          <item name="component" xsi:type="string">Magento_Catalog/js/components/new-category</item>
           <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
           <item name="dataScope" xsi:type="string">data.parent</item>
           <item name="filterOptions" xsi:type="boolean">true</item>
           <item name="showCheckbox" xsi:type="boolean">false</item>
           <item name="disableLabel" xsi:type="boolean">true</item>
           <item name="multiple" xsi:type="boolean">false</item>
           <item name="levelsVisibility" xsi:type="number">1</item>
           <item name="sortOrder" xsi:type="number">20</item>
           <item name="required" xsi:type="boolean">true</item>
           <item name="validation" xsi:type="array">
                  <item name="required-entry" xsi:type="boolean">true</item>
            </item>
            <item name="listens" xsi:type="array">
                  <item name="${ $.namespace }.${ $.namespace }:responseData" xsi:type="string">setParsed</item>
             </item>
      </item>
     </argument>
</field>


texts: Magento - Can I move 1 storeview from storename to another storename? And how can I do this without losing data?


texts: How to add new column in order csv export

texts:
I am trying to add a new field called quantity to the order csv export, but I am not able to do it.

With all the other fields that get exported, I want another column called quantity which shows the number of products that have been purchased in every row for that order.

Can anyone kindly let me know how I can achieve this?


texts: How to Add filter index with alias name in ui component of grid magento2

texts:
I created my custom module with admin grid, then i tried to add order increment id to my custom grid by altering the grid collection with alias name.

The order id is displaying in grid. Now, if I try to filter by increment_id , then  it throws an error. Without alias its working fine, if i add alias and try to filter at that time it throws the error.

Following is my code:

     <column name="order_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="filter_index" xsi:type="string">o.increment_id</item>
                    <item name="add_field" xsi:type="boolean">false</item>
                    <item name="label" xsi:type="string" translate="true">Order ID</item>
                    <item name="sortOrder" xsi:type="number">75</item>
                </item>
            </argument>
        </column>

app\code\Sugarcode\Test\Model\ResourceModel\Test\Grid\Collection.php

protected function _initSelect()
    {
         parent::_initSelect();
         $this->getSelect()->joinLeft(
            ['o' => 'sales_order_grid'],
            "(o.entity_id = main_table.id)",
            [
                'o.increment_id as order_id'
            ]
        );
    //$this->printLogQuery(true);
        return $this;
    }

So please tell how can I add the filter_index in magento2 with UI Component ?


texts:
I have found that magento has two separate ways of handling special prices but I don't know which is the best for my case. I found that catalog price rules are very powerful but I don't know how to loop through them without hardcoding the ID of the rule.

My client needs to have two kinds of special prices: normal discounts (20-30% off some products) and "flash sales" that last a short time (1-2 days). I need to have them show up in the home page and in the category pages, the ones in the home need to be selected by the admin from the backend and the ones in the category pages too, they will be set of 4 products on each page (the ones in the category pages need to be from said category). Then I have a link to a page with all the products that have special prices on them.

The "selecting" part of the deal I really don't know how to do but so far I can't even get the products with a catalog price rule to show up on my home page. I have a block for them and I found this code:

$rule = Mage::getModel('catalogrule/rule')->load(1);
$rule->setWebsiteIds("1"); $productIdsArray = $rule->getMatchingProductIds();
$productsCollection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect("*") ->addAttributeToFilter("entity_id", array("in", $productIdsArray));
$this->setProductCollection($collection);

But I'm guessing the ->load(1); is hardcoding the ID of the promo, what if the user creates a new price rule then? How do I loop all through all the products that have a rule in them?

I do know how to loop through special price products and maybe I could use them for the flash promos but I think I'll be complicating it with the rest of the features that I need to implement.

Also if you have any advice on how to handle the fact that the user needs to select the 4 featured products I would be very thankful.


texts: x% OFF tag in product listings, home and details page

texts:
I would like to add a x% OFF tag in products in home, listings, and product page, except for certain SKUs and categories.

This would be easily done by a catalog price rule.

My problem is that this only applies to banktransfer payment methods.

This suggests a shopping cart rule. Now this is a problem, when I try to validate the rule for listed products which aren't in shop cart.

If to go the catalog rule solution instead, I'm not certain about the layout, since I tested this and it showed a price like "old-price" with strike. I don't want to mirror the behavior of "special-price" layout here.

What would you suggest ?

Thank you.


texts: Magento 2 add multiple products to quote

texts:
I want to add multiple products to quote, but its adding only 1st product. I have used \Magento\Quote\Model\QuoteFactory for creating quote.

foreach ($items as $item) {
    $product = $this->product->loadByAttribute('sku', $item['sku']);
    if (!is_object($product)) {
        //If product not avilable then display error message
        echo(__(' Material with code ' . $item['sku'] . ' does not exist!' . '
'));
        continue;
    }
    $product = $this->product->load($product->getId());
    $productStock = $this->_stockItemRepository->get($product->getId());
    if (!$productStock->getIsInStock()) {
        //If product out of stock then display error message
        echo(__(' Material with code ' . $item['sku'] . ' is out of stock!' . '
'));
        continue;
    }
    //check for porduct quantity
    if ($productStock->getQty() < $item['confirmedQuantity']) {
        echo(__(' Material code ' . $item['sku'] . ' does not have ordered quantity!' . '
'));
        continue;
    }
    $product->setPrice($item['grossPrice']);
    $quote->addProduct($product, null);
    $quote->setCreatedAt($this->getDate($item['purchaseOrderDate']));
    echo $item['sku'] . "==";
}
//check quote item count
echo count($quote->getAllVisibleItems());

Quote count always print 1; there are 5 products in item array; output for item['sku']:

24-MB01==24-MB02==24-MB03==24-MB04==24-MB05==

but its always adding 1st product to quote. I have also checked in database.


texts: Add custom parameter in order's item in rest api magento 2

texts:
In magento 2, I have show specific custom option in order's item parallel to product name, sku.. rather than in parent_item array. I have only show in api not need to save in database.

Please anybody can help into this.
Thank you


texts:
Sanitizing like mysqli::real_escape_string in Magento2..

$sql = "INSERT INTO tbl_categories(col1, col2, col3) VALUES ('val1', 'val2', 'val3')";
$connection->query($sql);


texts:
i am sending admin edit page url for custom module as bellow.

One point is that i am sending admin url from frontend.

My link is http://127.0.0.1/magento/admin/Cutommodule/edit/id/62/key/c269essasd78532efcbfd583797b53c1bcfbb/

But it redirects me to Deshboard.


texts: How add custom functionality after product review?

texts:
Hi I am new to Magento

How to add custom functionality to Product review ??

I need to send a mail with discount coupons to user's email id once user has reviewed product.

How can I do this functionality please help me


texts:
Sales data missing from order reports but sales appear in the order grid

Magento ver. 2.1.9

we have some days they are showing some days and some that are show all the correct orders but some show nothing at at all.


texts:
I'm trying to add an external javascript file to a CMS page using the Layout Update XML feature, and have had no luck. I have tried the following

<action method="setText"><text><![CDATA[<script src="//ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>]]></text></action>

<action method="addJs"><script>http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0</script></action>

<action method="addItem">
<type>skin_js</type>
<name>http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0</name>
<params/>
</action>

The first two don't work at all, the third one adds it but prepends the skin url to the src.


texts: Same order different shipping address for each shipment

texts:
I am creating shipments programmatically for an order. The order has 3 shipments, I need each shipment to go to a different address.

The order has same product in qty 3. So each item(qty:1) needs to go to a different address but I am unable to change the address for the shipment. Here's what I've tried so far -

    $shippingAddressId = $this->order->getShippingAddress()->getId();

    $address = $this->addressRepository->get($shippingAddressId);

    $anotherAddress = $this->addressRepository->get(6);

    $address->setCountryId($anotherAddress->getCountryId());
    $address->setRegion($anotherAddress->getRegion());
    $address->setPostcode($anotherAddress->getPostcode());
    $address->setStreet($anotherAddress->getStreet());
    $address->setCity($anotherAddress->getCity());
    $address->save();

    $shipment->setShippingAddressId($shippingAddressId);
    return;

Thanks!


texts: Magento 1 - category view URL doesn't get routed, product view does

texts:
In the process of setting up my site, I have been unable to use category view links of the form:

/catalog/category/view/id/

Similar links to a product view page work just fine. The above leads to the "no-route" CMS page. I tried every category ID in my store, I tried reindexing data, clearing the cache, and disabling the few 3rd party modules I have installed.

Since I'm fairly new to Magento, any general tips on how to go about debugging a problem like this would be greatly appreciated!


texts: How i can use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool this class in custom module magento 2.4 graphql

texts:
We have
\Magento\CatalogGraphQl\Model\Resolver\Product\PriceRangeResolver
here  PriceProviderPool (Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool)

i have used in my custom module

but Error I'm getting :

Type Error occurred when creating object: Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool, Argument 1 passed to Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool::__construct() must be of the type array, null given, called in
i want create this price_range (Response in my custom module)
"price_range": {
            "maximum_price": {
              "discount": {
                "amount_off": 0,
                "percent_off": 0
              },
              "final_price": {
                "currency": "USD",
                "value": 34
              },
              "regular_price": {
                "currency": "USD",
                "value": 34
              }
            }
          }


texts: Adding attribute using JOIN to Collection

texts:
I have the following code snippet in my _prepareCollection function.  In this collection, I am missing an attribute that I need to have in order to display to a grid(style number).  I am able to access the attribute using the entity_id from the collection, but I have no idea how to go about joining this attribute to my collection.

protected function _prepareCollection() {

 $collection = $this->getOrder()->getProducts();
    foreach ($collection as $item){
        $styleNumber = Mage::getModel('Catalog/Product')->load($item->entity_id)->manufacturersstylenumber;
        //Join this style number to $collection
     }

    $this->setCollection($collection);
    return parent::_prepareCollection();
}

Edit: Output of $collection->getSelect()->toString();

SELECT `main_table`.*, `catalog/product`.*, `Purchase/CatalogProductDecimal`.`value` AS `sale_price`, `catalog_product_entity_varchar`.`value` AS `small_image` FROM `purchase_order_product` AS `main_table`
INNER JOIN `catalog_product_entity` AS `catalog/product` ON entity_id=pop_product_id
INNER JOIN `catalog_product_entity_decimal` AS `Purchase/CatalogProductDecimal` ON `catalog/product`.entity_id=`Purchase/CatalogProductDecimal`.entity_id and `Purchase/CatalogProductDecimal`.store_id = 0 and `Purchase/CatalogProductDecimal`.attribute_id = 64
LEFT JOIN `catalog_product_entity_varchar` ON `catalog/product`.entity_id=`catalog_product_entity_varchar`.entity_id and `catalog_product_entity_varchar`.store_id = 0 and `catalog_product_entity_varchar`.attribute_id = 75 WHERE (pop_order_num = '3')

Edit: I suppose my question is how would I create a join using entity_id to my catalog/product and adding the styleNumber attribute for my addColumn later.


texts: How can we migrate only customers, products and orders data using Data Migration tool?

texts: I am using Magento 2.3 version. Is it possible to migrate only customers, products and orders data from Magento 1 site using Data Migration tool? Please help me. Thanks in advance.


texts: custom ajax call on billing address update magento 2

texts:
I am developing custom payment method, I need to call my js method renderer function when customer update billing address while checkout.

I try to place this call in initialize but my method is not calling.

Any suggestions?


texts: Magento 2 - Setup page not displaying correctly

texts:
I am trying to install a magento 2 on an OVH shared hosting with a private sql server. I copied a magento 2 new package and I am currently encountering the following error when trying to launch the setup :

http://xxxxxx/setup/index.php/navigation Failed to load resource: the server responded with a status of 404 (Not Found)
http://xxxxxx/setup/index.php/navigation/side-menu Failed to load resource: the server responded with a status of 404 (Not Found)
http://xxxxxx/setup/index.php/navigation/header-bar Failed to load resource: the server responded with a status of 404 (Not Found)

Then after some time waiting on the page i get this :

angular.js:7715 POST http://xxxxxx/setup/index.php/session/prolong 404 (Not Found)

The setup works fine in local, what should I do ?

It isn't a Symlink error, I already modified the "virtualType name="developerMaterialization" section, and deleted files under pub/static.

My errors are angular.js errors.


texts:
How to add google map contact us page form.phtml file in magento 2.2

please advance thanks for help.


texts: how to change the magento theme structure of my second store

texts:
i made a second website in my main magento store by using sub directory. it is ok and running.But i want to show extra template for that. where to edit and put..

And what is my directory structure of my second store?


texts:
Magento EE v1.14.x, CentOS 7

We already have a website/store/view shop which works fine, listening on 'shop.mydomain.co.uk'.

We just tried adding a new website/store/view by:

Registering 'shop2.mydomain.co.uk' with DNS.
Configuring Apache to serve virtualhost 'shop2.mydomain.co.uk':

<VirtualHost *:80>
    DocumentRoot /ssddata/www/shop.mydomain.co.uk
    ServerName shop2.mydomain.co.uk
    ErrorLog logs/shop2.mydomain.co.uk/error_log
    CustomLog logs/shop2.mydomain.co.uk/access_log common

    <Directory "/ssddata/www/shop.mydomain.co.uk">
        Require ip 10.11.0.0/16
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
        Order allow,deny
        Allow from all
    </Directory>

    SetEnv MAGE_RUN_CODE "shop2_site_code"
    SetEnv MAGE_RUN_TYPE "website"

</VirtualHost>

Creating the appropriate new website/store/view in Magento Admin.
Configuring Magento web management for the new site to use a new custom CMS homepage, new custom 'CMS No Route Page' and set the Base URL to use "http://shop2.mydomain.co.uk/".

Everything seems fine, and we have read at least a dozen online guides, however, when we browse to our new site ('shop2.mydomain.co.uk'), the browser responds with

shop2.mydomain.co.uk redirected you too many times.

I know there are many many similar questions everywhere on this issue, but none fit our circumstances (and none of their solutions work for us). For instance, the rest of our Magento instance is fine. The Admin area is still online and our primary shop is still working fine.

What I have done/checked:

[magento root]/.htaccess is fine.
All file permissions are fine.
I have tried cleaning out all browser cookies, browsing "incognito" and even new browsers.
Cleared out [magento root]/var/cache.
Cleared out [magento root]/var/session.
Flushed all Magento caches.
Checked Apache and Magento logs.

I have found that if I remove the two SetEnv commands from the Apache virtualhost then I can browse to the 'shop2.mydomain.co.uk' URL but Magento serves the primary site/shop. So, it must be something to do with Magento trying to run the specified website code (via MAGE_RUN_CODE) which causes a loop. But I don't understand why or how.

We are running out of ideas as to why this new site is endlessly redirecting.

Does anyone have any suggestions to get this new site working please?

UPDATE 1
Something I should add is that when the browser reports "redirected you too many times", the address bar changes to: "http://shop2.mydomain.co.uk/no-route".
So Magento must be responding somehow, as it tries to redirect it to it's default "404 Page not found" page (URL-key: no-route). Interestingly though, the URL-key in our configuration for shop2.mydomain.co.uk's "404 page not found" page is actually "shop2-no-route", not "no-route". No idea if this is significant or helpful though! :)


texts:
I have deployed Magento machine on Centos7 Machine. When I try to login to the admin page, it tries to redirect to the same page. i have already tried clearing the cookies. But that has not helped. SSL is enabled on the machine. Based on this question, it is because SSL is enabled, I have tried the fix mentioned as well.

Not all users face the issue. Now the admin page doesn't popup as it says there were too many redirects from this page.

Unless the cookies are cleared no user is able to get the admin page without redirect.


texts:
We have setup Magento default cron by using following commands
bin/magento cron:install [--force]

crontab -l

#~ MAGENTO START c5f9e5ed71cceaabc4d4fd9b3e827a2b
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/www/html/magento2/var/log/magento.cron.log                                                                                |
* * * * * /usr/bin/php /var/www/html/magento2/update/cron.php >> /var/www/html/magento2/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento setup:cron:run >> /var/www/html/magento2/var/log/setup.cron.log
#~ MAGENTO END c5f9e5ed71cceaabc4d4fd9b3e827a2b

Cron setup completed successfully.While the cron is getting executed we observerd the  server getting slowdown and magento default folder permissions are getting changed.
Can anyone provide the solution to fix this problem


texts: Magento 2 product attribute filter url rewrite?

texts:
I have override url-rewrite router in my custom module,and add my custom rewrite code in override router file.
after filter url created like below :

  http://domainname.com/services.html?manufacturer=41

But I want to create url like :

  http://domainname.com/services/aruba

I am using below code for rewrite url in router file .it's not working. it's goes to 404 result page.

    //custom code
  if ($request->getModuleName() === 'catalog' || $request->getModuleName() === 'cms') {
    return;
      }
   $identifier = trim($request->getPathInfo(), '/');
    $urlKey_explode = explode('/', $identifier);

     if($urlKey_explode[0]=='services')
    {
        $url_string = $urlKey_explode[1];

        //get manufacture
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        //Select product attribute from table
        $sql = "SELECT
                    eav_attribute_option_value.option_id  , eav_attribute_option_value.value
                FROM
                    eav_attribute_option_value
                    join `eav_attribute_option` on `eav_attribute_option`.option_id = eav_attribute_option_value.option_id
                WHERE
                    eav_attribute_option.attribute_id = 83
                group by
                    eav_attribute_option_value.option_id";
        $result_has_options_attribute_option = $connection->fetchAll($sql);
        foreach ($result_has_options_attribute_option as $key => $value)
        {
            $productattriburtname = $value['value'];

            if(strpos($url_string, $productattriburtname) !== false){
                $manufacturerlabel = $value['value'];
                $url_string = str_replace($productattriburtname, "-", $url_string);
                break;
            }
        }
    $request->setModuleName('catalog')->setControllerName('category')->setActionName('view');
    $request->setParam('manufacturer', $manufacturerlabel);

    $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, $identifier);

    return $this->actionFactory->create(
        'Magento\Framework\App\Action\Forward',
        ['request' => $request]
    );

    }
    //end custom code

Please advise me.


texts: One page checkout login fail (integrity constraint violation 1452)

texts:
I have a problem on my Magento website, as the login on the one page checkout doesn't work (the classic one does). When I try to login from the checkout page, it just refresh the page and do nothing (no error message and no logs).

I investigated on that problem and I discoverd that in the file app/code/core/Mage/Customer/controllers/AccountController.php inside the method loginPostAction() there is a commented line:

// Mage::logException($e); // PA DSS violation: this exception log can disclose customer password

If you uncomment this line, an exception appears in the log files:

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`bbmarketplace`.`magentosales_flat_quote_shipping_rate`, CONSTRAINT `FK_8A798F8F0479792A74EFD849B1C80E74` FOREIGN KEY (`address_id`) REFERENCES `magentosales_flat_quote_address` (`address_id`)), query was: INSERT INTO `magentosales_flat_quote_shipping_rate` (`address_id`, `created_at`, `updated_at`, `carrier`, `carrier_title`, `code`, `method`, `method_description`, `price`, `method_title`, `udropship_vendor`) VALUES (?, '2015-05-13 12:20:58', '2015-05-13 12:20:58', ?, ?, ?, ?, ?, ?, ?, ?)'

After some more investigation, I discovered this problem comes from the method setQuoteGuest() inside the file app/code/Mage/Persistent/Model/Observer.php:

 public function setQuoteGuest($checkQuote = false)
    {
        /** @var $quote Mage_Sales_Model_Quote */
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        if ($quote && $quote->getId()) {
            if ($checkQuote && !Mage::helper('persistent')->isShoppingCartPersist() && !$quote->getIsPersistent()) {
                Mage::getSingleton('checkout/session')->unsetAll();
                return;
            }

            $quote->getPaymentsCollection()->walk('delete');
            $quote->getAddressesCollection()->walk('delete');
            $this->_setQuotePersistent = false;
            $quote
                ->setIsActive(true)
                ->setCustomerId(null)
                ->setCustomerEmail(null)
                ->setCustomerFirstname(null)
                ->setCustomerLastname(null)
                ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)
                ->setIsPersistent(false)
                ->removeAllAddresses();
            //Create guest addresses
            $quote->getShippingAddress();
            $quote->getBillingAddress();
            $quote->collectTotals()->save();
        }

        $this->_getPersistentHelper()->getSession()->removePersistentCookie();
    }

To solve my problem, I've overwritten the file and commented the line $quote->getAddressesCollection()->walk('delete');.

Now it works fine, but I really would like to know why I have to comment that line in order to be able to log in on the checkout page.

I don't really understand what this method does and why I have to comment this line, and it bother me. I get that it solve the constraint violation, but I would like to know why I've got this violation in the first place.

thank you


texts: random items added to order after purchase?

texts:
I've recently seen this issue where orders are coming through as normal but customers are getting in touch to let us know there is an additional item/(s) in their order confirmation that they did not want. Upon checking, they also haven't paid for this but Magento is showing that everything has been successfully invoiced.

Any ideas on where to start?


texts: subdivide the products in "percent categories"?

texts:
we want to have 3 buttons on our webpage where we want to subdivide the most of our articles in 3 groups:

first group: 50-60%

second group: 60-70%

third group:  over 70%  of  the normal UVP - shop price...

because we are an outlet shop!

Is there any module update for magento 1.9 ?


texts:
I moved my website from old hosting to new hosting and its giving me error every were like following

please any one sort this out

There has been an error processing your request
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

Trace:
#0 C:\inetpub\vhosts\dotnpixel.uk\intu.online\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Zend\Db\Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 C:\inetpub\vhosts\dotnpixel.uk\intu.online\lib\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 C:\inetpub\vhosts\dotnpixel.uk\intu.online\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ad...', Array)
#4 C:\inetpub\vhosts\dotnpixel.uk\intu.online\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ad...', Array)
#5 C:\inetpub\vhosts\dotnpixel.uk\intu.online\lib\Zend\Db\Adapter\Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ad...', Array)
#6 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\AdminNotification\Model\Resource\Inbox.php(120): Zend_Db_Adapter_Abstract->insert('adminnotificati...', Array)
#7 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\AdminNotification\Model\Inbox.php(118): Mage_AdminNotification_Model_Resource_Inbox->parse(Object(Mage_AdminNotification_Model_Inbox), Array)
#8 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\AdminNotification\Model\Feed.php(97): Mage_AdminNotification_Model_Inbox->parse(Array)
#9 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\AdminNotification\Model\Observer.php(50): Mage_AdminNotification_Model_Feed->checkUpdate()
#10 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Core\Model\App.php(1338): Mage_AdminNotification_Model_Observer->preDispatch(Object(Varien_Event_Observer))
#11 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_AdminNotification_Model_Observer), 'preDispatch', Object(Varien_Event_Observer))
#12 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#13 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Core\Controller\Varien\Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
#14 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Adminhtml\Controller\Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#15 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Core\Controller\Varien\Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#16 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#17 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#19 C:\inetpub\vhosts\dotnpixel.uk\intu.online\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#20 C:\inetpub\vhosts\dotnpixel.uk\intu.online\index.php(90): Mage::run('', 'store')
#21 {main}


texts:
I'm trying to upload my plugin to the Magento Marketplace but it keeps giving the following error:

  The "package.xml" file does not exist; please verify the archive.

I have the package.xml file in the root of the archive along side the app and skin folders. Do i have the package.xml file in the correct place?


texts:
I'm getting the following errors in my exception.log:

  exception 'Mage_Core_Exception' with message 'Invalid block type:
  Mage__Block_Catalog' in
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/Mage.php:594 Stack
  trace:
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(495):
  Mage::throwException('Invalid block t...')
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(437):
  Mage_Core_Model_Layout->_getBlockInstance('/catalog/produc...', Array)
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(472):
  Mage_Core_Model_Layout->createBlock('/catalog/produc...',
  'product_list')
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(239):
  Mage_Core_Model_Layout->addBlock('/catalog/produc...', 'product_list')
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(205):
  Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element),
  Object(Mage_Core_Model_Layout_Element))
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(210):
  Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(210):
  Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(344):
  Mage_Core_Model_Layout->generateBlocks()
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Catalog/controllers/CategoryController.php(146):
  Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(419):
  Mage_Catalog_CategoryController->viewAction()
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250):
  Mage_Core_Controller_Varien_Action->dispatch('view')
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php(46):
  Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176):
  ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/code/core/Mage/Core/Model/App.php(354):
  Mage_Core_Controller_Varien_Front->dispatch()
  /var/www/vhosts/my.websiteaddress.com/httpdocs/app/Mage.php(683):
  Mage_Core_Model_App->run(Array)
  /var/www/vhosts/my.websiteaddress.com/httpdocs/index.php(137):
  Mage::run('uk', 'website')

So it looks like the module name isn't being declared, hence the double underscore: Invalid block type: Mage__Block_Catalog

So my question is, where can I find to add in the module name for this?


texts:
I want to override the default functionality of stores (adding some fields like commission , location to deliver etc ), but i am not able to configure it. My configure file as follows

    <config>
  ...

    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <store before="Mage_Adminhtml">Mycompany_Store_Adminhtml_Store</store>
                    </modules>
                </args>
            </adminhtml>
        </routers>
</admin>
 </global>
....
 </config>

It doesnt work at all.


texts:
I want to add request quote button in product view page that submits all the information in the admin grid instead of view shopping cart.

Actually, I have created two buttons, one is add to cart & other is request for quote.

If the user selected product options like size (which is defined from backend custom option, input type = dropdown). In this case, User can only show add to cart button & request for quote button is hidden.

If the user selected product options like size (which is not manually defined from backend - for example, input type = field). In this user can enter the size from the front end. In this case, a user can only show the request for quote button.

I have done the button cases. But How do I send the selected data in the custom admin grid from the product detail if a user clicks on request for quote button?

or

Just want a page similar to the shopping cart if the user selects a request for a quote but he is not able to proceed to checkout.


texts: Porto Theme 2.1.0 in Magento 2.1.1 Minicart Problem

texts: After I upgrade my magento 2.0.7 in magento 2.1.1 I was experiencing this problem in my site. The minicart also is not functioning well.


texts: Magento2: How to get additional-fieldsets for custom address form(Not in checkout page)

texts:
In a custom template phtml I initialized an UI component

In list.html I call

In address.html template I called a shipping-address form

And in form template we have

But seem like I didn't get any getRegion('additional-fieldsets') and template for my custom form. Any help?

Like this


texts: Migrate Magento EE 1.14.3.1 to Magento CE 2.1.7

texts:
How to migrate Magento Enterprise Version 1.14.3.1 to Magento Community Version 2.1.7?

I am not getting perfect solution for migrate from M1 Enterprise to M2 Community.

Official Data-migration-tool is not providing solution for this so please help me to migrate Step-by-Step.


texts: Can I Track Online Customer History and Cart?

texts:
I've searched and haven't found exactly what I'm looking for.  Back when I used osCommerce, I had something similar to this coded, but that was a much more simple system to hack away at.

I'd like to pull up a real-time report (similar to Google Analytics Real-Time) that tells me how many active [human] visitors are shopping at my store at any given time.  I'd then like the ability to click on one to view their history (past visit dates/lengths, current visit trail and current items in cart).  In fact, if there is a way to do this with GA, that would be fine with me!

Why?  Because I want to see where in the funnel people are getting bogged down in real time and see instant response to newly launched promotions.   Also, I would like the ability to display a cart ID to a customer during checkout with our phone number so they can finish the checkout verbally in case they either don't like on-line ordering or are having a problem.  That would expedite the process of phone reps looking up products for a customer.

Has anybody had experience with an extension or service similar to this for Magento?


texts:
i have Source Sans Pro in my stylesheets everywhere, i just realized that it's showing Sans Serif on the computer that doesn't have Source Sans Pro installed. but it's showing the correct font on the computer that has the font installed.

so the font has to be installed on the person's computer for it to show? i was hoping it will show up whether the person has it or not.

here's the site, you can see for yourself.
booomchik.com, everything should be Source Sans Pro, headers, text, buttons, everything


texts: Magento 2 Catalog Search ElasticSearch Resave All Products Issue

texts:
I have a Magento 2.2.2 site - hosted on a dedicated server, linux centos6, apache, nginx, which is running fine however I have had to delete and re-import attribute manufacturer - brand - all entries have been imported ok however they are not showing on front end in the layered navigation.

I have since found that changing the Stores/Configuration,Catalog Search/Search Engine setting from ElasticSearch to MySQL and refresh cache all brands are showing in Layered Navigation and All Brands Page.

I then changed the setting back to ElasticSearch and Went to some products and without making any changes just resaved via Admin and cleared cache and now the ones resaved are showing on frontend.

I have also found that they will only show on front end if resaved via Admin and not by any other method.

This is a very strange issue and wasted 3 days on it already.

I exported original without resaving and also resaved products via import/export, and all settings seem to be same in the exported file for those products resaved.

So I am assuming it is some value being changed in Database which can only be done when saved via Admin.

I tried to create another test attribute and do mass update changing the value and hoping it will resave all attributes once again but I got the error
something went wrong when saving the attributes.

Can anyone provide any suggestion into what is causing this issue and how to fix and avoid it in future,

Thank You


texts: How Do I fix this Magebuzz Testimonial Extension?

texts:
Recently, I purchased and installed a Testimonial extension for Magento2 from Magebuzz.

http://www.magebuzz.com/free-testimonial-for-magento-2.html

The customer service has been non-existent. So, I would like to try to fix this myself, but I'm not sure the exact problem. I'm wondering if anyone with great troubleshooting skills can help or has dealt with extension will know. Here's what happened.

I uploaded all of the Magebuzz Testimonial files to my root magento2.
Then I ran the command lines:

php /bin/magento module:enable Magebuzz_Core
php /bin/magento module:enable Magebuzz_Testimonial
php /bin/magento setup:upgrade
php /bin/magento setup:di:compile
php /bin/magento cache:flush

So when I log into my admin panel and refresh magento cache, also flush magento cache and magento cache storage. I do successfully see that the Testimonial extension and its components (configuration inputs, etc) has been added to the Admin panel. However when I click on the Content section --> Testimonial --> Memo to create a manual testimonial, no matter what when I click the OK button to finally save and enter the manual testimonial, the page just turns white and does nothing else. Not eve spin the wheel in the browser tab to show that it's doing anything. It does nothing. This leads me to believe that something was missing from the extension files. I looked in the Database for any tables named Magebuzz or Testimonial - there were NONE. I would think there should be a DB table to at least hold all of the entries, right? Also the link in the browser of the white static page after attempting to add the manual testimonial was something like this:

https://www.myWebsite.com/myAdmin/testimonial/memo/save/key/40bd44249b899735620494b253c683b976e412b2171aAAf40368177244f4b025/active_tab/main_section/

I am using Magento 2.1.7, on linux, PHP 7

Thanks in advance for your help.


texts: How to get current Cart_id/quote_id in plugin file Magento 2?

texts:
namespace Asm\Setsellerid\Plugin;
use Magento\Quote\Model\Cart\Totals\ItemConverter;
use Magento\Quote\Api\Data\TotalsItemExtensionFactory;

class Item
{
    /**
     * @var TotalsItemExtensionFactory
     */
    protected $totalsItemExtensionFactory;

    /**
     * ItemConverterPlugin constructor.
     *
     * @param TotalsItemExtensionFactory $totalsItemExtensionFactory
     */
    public function __construct(
        \Magento\Checkout\Model\Cart $cart,
        TotalsItemExtensionFactory $totalsItemExtensionFactory
    ) {
        $this->totalsItemExtensionFactory = $totalsItemExtensionFactory;
         $this->cart = $cart;
    }

    /**
     * @param ItemConverter $subject
     *
     * @param $result
     * @return mixed
     */
    public function afterModelToDataObject(
        ItemConverter $subject,
        $result
    ) {

        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('Your text message');

        $cart = Mage::getModel('checkout/cart')->getQuote();
            foreach ($cart->getAllItems() as $item) {
                $productName = $item->getProduct()->getName();
                $productPrice = $item->getProduct()->getPrice();

                $logger->info($item->getProduct()->getName());
                $logger->info($item->getProduct()->getPrice());
            }

        $extensionAttributes = $result->getExtensionAttributes();
        if ($extensionAttributes === null) {
            $extensionAttributes = $this->totalsItemExtensionFactory->create();
        }
        $pointsDelta = 60;
        $extensionAttributes->setMine($pointsDelta);
        $result->setExtensionAttributes($extensionAttributes);
        return $result;
    }
}

Here am trying fetch current cart_id but it showing error like..

/Setsellerid\/Plugin\/Item.php' on line 57","trace":"Trace is not available.

so how to get current cart id, thank you in advance


texts: incorrect magento 2 version being installed on composer update

texts:
I'm trying to install Magento 2.3.3 but for some reasons it keeps on installing 2.4.0. I tried clearing the composer cache and reinstalling everything(delete vendor and composer.lock). but it always install 2.4.0 every time I run a composer update. here's my composer.json
"require": {
    "magento/product-community-edition": "^2.3.3",
    "adyen/module-payment": "^2.1",
    "magento/data-migration-tool": "^2.3.1",
    "zendframework/zend-stdlib": "~3.2.1",
    "zendesk/zendesk_api_client_php": "^2.2"
},
"require-dev": {
    "allure-framework/allure-phpunit": "~1.2.0",
    "friendsofphp/php-cs-fixer": "~2.14.0",
    "lusitanian/oauth": "~0.8.10",
    "magento/magento-coding-standard": "~3.0.0",
    "magento/magento2-functional-testing-framework": "2.4.5",
    "pdepend/pdepend": "2.5.2",
    "phpmd/phpmd": "@stable",
    "phpunit/phpunit": "~6.5.0",
    "sebastian/phpcpd": "~3.0.0",
    "squizlabs/php_codesniffer": "~3.4.0"
},

does anyone have an idea why this is happening? 2.4.0 is quite unstable and I don't want to use it yet.
running php bin/mangeto --version return 2.4.0
same when checking composer.lock


texts: How can I get product alt text or image caption on detail page outside media gallery?

texts: I want to get product Alt text on detail page outside media gallery. I enable caption from view.xml and it works. But it displaying on product image. I want to display it outsite media gallery or after product title.


texts: URL Rewrite Management "Custom" as Default Option

texts: I would like to make the "Custom" redirect option the default when creating URL Rewrites. Is that possible and, if so, how?


texts:
I want to change the store of my magento website based on the url.
For example if I open up a URL that exists on my secondary store I get a 404 if it's not the first time entering the website.
Basically I think I would need an observer to check where that url is available and switch the store accordingly.
Obviously the urls will be unique.
Thanks and I hope someone can help me or give me a direction as I have looked for modules and other info but all I could find was geoip redirection.


texts: External file cart empties when using browser back button

texts:
I have the following code in an external file(same domain) to get the current cart details, and I'm getting all details without any issues.

The problem is,  when I go to the checkout page using 'Go to checkout' and press browser back button this cart gets empty. I mean only on this external file.

When I click the 'view and edit cart' and uses the browser back button the cart is fine.

Any help would be appreciated!

<?php
ini_set("display_errors", true);
ini_set("error_reporting", E_ALL);

require '/var/www/html/app/bootstrap.php';

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$obj = \Magento\Framework\App\ObjectManager::getInstance();
$obj->get('Magento\Framework\App\State')->setAreaCode('frontend');

$storeManager = $obj->create("\\Magento\\Store\\Model\\StoreManagerInterface");
$storeManager->setCurrentStore(1);

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

// Getting the object managers dependencies
$quote = $obj->get('Magento\Checkout\Model\Session')->getQuote();
$shoppingcart = $obj->get('\Magento\Checkout\Model\Cart');

$imagehelper = $obj->get('\Magento\Catalog\Helper\Image');

// Get quote and cart items collection
$quote = $shoppingcart->getQuote();
$quoteitems = $quote->getAllItems();

// Getting cart
$cart= $shoppingcart->getCart();

// Getting the subtotal of the cart
$subtotal = number_format($quote->getBaseSubtotal(), 2);
$qty = 0;

$arrProducts = array();
$mediaurl= $storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
$baseurl = $storeManager->getStore()->getBaseUrl();

$j = 0;
foreach ($quoteitems as $item)
{
    $arrProducts[$j]['productID'] = $item->getProductId();
    $arrProducts[$j]['productName'] = $item->getName();
    $arrProducts[$j]['productQty'] = $item->getQty();
    $arrProducts[$j]['productPrice'] = number_format($item->getPrice(),2);

    $qty += $item->getQty();

    $_product = $obj->get('Magento\Catalog\Model\Product')->load($item->getProductId());
    $arrProducts[$j]['productUrl'] = $_product->getUrlKey();
    $arrProducts[$j]['productImage'] = $mediaurl.'catalog/product'.$_product->getSmallImage();

    $j++;
} ?>

<?php
    if($qty > 0 && !empty($arrProducts)){ ?>

            Cart Subtotal: $<?php echo $subtotal; ?>
            <?php echo count($arrProducts);?> Item(s) in Cart
            GO TO CHECKOUT
        <?php
        foreach($arrProducts as $product){ ?>

                <a href="https://example.com/<?php echo $product['productUrl'] ?>/"><img src="<?php echo $product['productImage'] ?>" />
                <a href="https://example.com/<?php echo $product['productUrl']?>/"><?php echo$product['productName']?>

                    $<?php echo$product['productPrice']?>

Qty: <?php echo $product['productQty']?>

    <?php } ?>
        VIEW AND EDIT CART

    <?php }else{ ?>
        You have no items in your shopping cart.
   <?php  } ?>


texts:
I am trying to add a custom block to the admin order view page and am doing this via an observer using the event core_block_abstract_to_html_before. I am using the giftmessage block, clone it and add it as a child in my own block

Observer code:

public function insertAdminBlock($observer)
{
    $_block = $observer->getBlock();
    $_type = $_block->getType();

    if ($_type == 'adminhtml/template')
    {
        if ($_block->getChild('order_giftmessage'))
        {
            $_child = clone $_block;
            $_child->setType('adminhtml/sales_order_view_info');
            $_block->setChild('giftmessage', $_child);
            $_block->setTemplate('mymodules/adminview.phtml');

        }
    }
}

the template looks like this:

<?php echo Mage::helper('sales')->__('Custom Value') ?>

    <fieldset>

             <?php echo Mage::helper('sales')->__('Custom Value:') ?>
             <?php var_dump($this->getOrder()->getValue())?>

    </fieldset>

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

The block gets inserted between the Payment/Shipping Method and Items block.

However the function $this->getOrder does not work in my block as the result is empty. Any ideas what I am missing?


texts: What should be the server configuration for Magento 1.9?

texts: What should be the server configuration for Magento 1.9 which can handle 70k Configurable products and 500k simple products? Also 4000 users at a time on website


texts: Updating the downloadable products link (and file), when it is changed in admin panel, in Magento 2

texts:
I am not really sure if this is a bug in Magento or I am missing something. Every time I change the file (Add a new file) to a downloadable product in the Admin end, the file does not update for the customers who already bought it and have it in their download list.

I found This solution for Magento 1.7, I tried it in Magento 2.2 but it did not work. Is there an alternative for Magento 2 as well that anybody is aware of?

Please let me know if there is an obvious way of fixing this and I am missing it, thank you!


texts:
I have 20 checkbox options (added via custom options) available so the customer can customise the product. I would like to make sure the customer has ticked/checked at least 6 of the checkboxes.

I have written some JS to count how many  of the options have been checked and highlight the options in red if fewer than six have been selected, but how do I integrate that JS so the Add to Cart button will run my custom JS as well as the usual validation?


texts: Simple product with attributes(Color and Size)

texts: Can we make a simple product with attributes(Colors and size) for rental product cause I want to show attributes in simple product?


texts: change position and tittle tab "description and review" in product view

texts:
how step detail if i want to change tittle and position tab description and review in product page magento 1.9.3 like this
before

after

Any suggestions please. thanks


texts: Magento 2 - Ajax is not calling Controller

texts:
I tried to make a simple ajax-call to my controller.

Somehow I don't get a valid response.

MyCompany/MyModule/Index/GetAjax.php

namespace MyCompany\MyModule\Controller\Index;

class GetAjax extends \Magento\Backend\App\AbstractAction {

        public function __construct(
               Context  $context,
               \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
        ) {

            $this->resultJsonFactory = $resultJsonFactory;
            parent::__construct($context);
        }

        public function execute() {
        /** @var \Magento\Framework\Controller\Result\Json $result */
        $result = $this->resultJsonFactory->create();
        return $result->setData(['success' => true]);
       }
}

MyCompany/MyModule/etc/frontend/routes.xml

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

MyCompany/MyModule/view/frontend/web/js/test.js

define(['jquery'],
    function ($) {
         $(document).ready(function() {

              $.ajax({

                url : 'mymodule/index/getAjax',
                type : 'GET',
                data: {
                    format: 'json'
                },
                dataType:'json',
                success : function(data) {
                    alert('Data: '+data);
                },
                error : function(request,error)
                {
                    alert("Error");
                }
            });

         });
    });

I get my error message and in my console I get

  JQMIGRATE: jQuery.parseJSON requires a valid JSON string.

Besides if I try to enter mymodule/index/getAjax url in my browser there is a

  Error 500 (internal server error)

Can anyone help me out?


texts: import with AvS_FastSimpleImport and base_price Module

texts:
The Baseprice Module provides this fields: base_price_amount, base_price_base_amount, base_price_base_unit and base_price_unit.

On import procedure with avs_fastsimpleimport, all the other fields (sku, name, price ...) are correctly processed.
The fields for base_price are ignored.
Why?

My Import-Array shows like this:

$artData[] = array(
'sku' => $line[0],
'_type' => 'simple',
'_attribute_set' => 'Default',
'_product_websites' => 'base',
'_category' => $cat_det[0]['entity_id'],
'name' => $artBez,
'price' => $price,
 ...

// this fields will be ignored:
'base_price_amount' =>1,
'base_price_base_amount'=>1,
'base_price_base_unit' => 'PCS',
'base_price_unit' => 'PCS',


texts: Magento2 Back in stock mail is taking wrong from name and from email

texts:
Magento2.2.7 I am facing a strange issue.

The site is multi-store

when a mail is fired for Back-in-stock products at that time the Form Name & Form Email is taken from the Base store & not from the one mentioned for a particular store.

Any suggestions will be appreciated.

Already installed MDVA-10993_EE_2.2.4_v1.composer.patch from https://github.com/magento/magento2/issues/14952


texts: How to convert install/upgrade schema scripts to db_schema.xml files?

texts:
I'm following the guide from Magento DevDocs about the Declarative Schema

I created a new module with old setup way (InstallSchema.php, InstallData.php) to test the convert install/upgrade schema scripts to db_schema.xml config. I ran two commands:

bin/magento setup:install --convert-old-scripts=1
bin/magento setup:upgrade --convert-old-scripts=1

But, I didn't see the db_schema.xml in my custom module. Why the db_schema.xml didn't generate in my module?

I also see the note from Magento

  The Schema Listener tool listens for schema changes and attempts to
  change Magento code, so it should not be run in production mode. It is
  disabled by default.

So, what should I do in my case? My app is in developer mode.


texts: How can i check the customer is confirmed or not before login?

texts:
How can i check the customer is confirmed or not before login.

this is my login function :

public function loginAction() {
    if ($this->getRequest()->isPost()) {
        $session = $this->_getSession();
        if (Mage::getSingleton ( 'customer/session' )->isLoggedIn ()) {
            $session->logout ();
        }

        $username = Mage::app ()->getRequest ()->getParam ( 'username' );
      $password = Mage::app ()->getRequest ()->getParam ( 'password' );

        try {
      if ($session->getCustomer()->getIsJustConfirmed()) {
            if (!$session->login ( $username, $password )) {
                echo json_encode(array('status' => 'error','message'=> $this->__('wrong username or password.')));
                exit;
            } else {

                echo json_encode(array('status' => 'success','message'=>$this->statusAction ()));
                exit;
            }
      }else {
        echo 'bla bla bla';
      }
        } catch ( Mage_Core_Exception $e ) {
            switch ($e->getCode ()) {
                case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED :
                    //$value = Mage::helper ( 'customer' )->getEmailConfirmationUrl ( $username );
                    $message = Mage::helper ( 'customer' )->__ ( 'This account is not confirmed.');
                    echo json_encode ( array (
                            'status' => 'error',
                            'message' =>  $this->__($message )
                    ) );
                    break;
                case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD :
                    $message = $e->getMessage ();
                    echo json_encode ( array (
                            'status' => 'error',
                            'message' => $this->__($message )
                    ) );
                    break;
                default :
                    $message = $e->getMessage ();
                    echo json_encode ( array (
                            'status' => 'error',
                            'message' => $this->__($message )
                    ) );
            }
        }
  }
}

iv'e used $session->getCustomer()->getIsJustConfirmed() but it's not working.

how can i fixe it ?


texts: Magento 2: Sql query for updating product image path by SKU

texts: Need Sql query for updating product image path by SKU


texts:
I want to get product's url so i use getProductUrl() in result its return a url address that seems be correct but its not,When i want to open it the store return 404 not found error.

$product = Mage::getModel('catalog/product')->load($productId);
$url => $product->getProductUrl();

//It's return

// http://mg1.dev/index.php/catalog/product/view/id/905/s/plaid-cotton-shirt-royal-blue-l/


texts: Magento 2 simple module not working on a particular system

texts:
I have just created a "HelloWord" module and I just tested it on many systems but its not working on a particular system with XAMPP (PHP 5.5, MySQL 5.6.24) and Ubuntu 14.04 LTS running.
5.
Here is the package: https://dl.dropboxusercontent.com/u/98186464/Amin.rar

What should I check or config in PHP or Apache or Ubuntu to get it work ? The strange thing is that Magento 2 is running and working in this particular systems but only my simple HelloWorld module is not working properly (it doesn't load the layout in /helloworld/index/index controller, and simply just shows the title "Amin Helloworld", but the layout is not loaded at all)


texts:
How can I limit the maximum order amount every 3 months ? I tried using this one (https://inchoo.net/ecommerce/magento/magento-maximum-allowed-order-amount/) but its for every order, and I wanted to only be able to buy x$ every 3 months.

Really need help with this one :(


texts: Magento 2: Interceptor Error better way to solve?

texts:
I'm using Magento 2 CE Version 2.1.0 on WAMP.

When we receive below kind of error

  a:4:{i:0;s:414:"Recoverable Error: Argument 6 passed to
  Magento\Catalog\Controller\Adminhtml\Product\Save::__construct() must
  be an instance of Magento\Catalog\Api\ProductRepositoryInterface, none
  given, called in
  /var/www/magento2/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php

Will do follow steps

Remove module folder from var/generation
Run magento setup:upgrade, magento setup:di:compile, magento cache:flush Commands

At the time of magento setup:di:compile

Application Code Generator takes so much time.

In overall process takes approximately 10 minutes to solve above error. Is there any better way to solve it & saving time?


texts: How to display field "Tax number" during registration

texts:
I have displayed additional fields during registration (address information).

I miss the "Tax number" field. How can I display this field during registration?


texts: checkout_cart_add_product_complete not fired. Bug or feature?

texts:
While trying to answer this question I ran into a strange behavior.

The checkout_cart_add_product_complete event is working nice while adding a product to cart from a catalog. However if I try to move product to cart from a wishlist the event doesn't fire.

The reason for it Mage_Wishlist_IndexController::cartAction() is adding product to cart through Mage_Checkout_Model_Cart::addProduct() method and not through cart controller (where checkout_cart_add_product_complete is firing).

So the question is if it was made intentionally or is it a bug?


texts:
I have followed the tutorial and making a simple REST API.

api2.xml FILE

<?xml version="1.0"?>
<config>
    <api2>
        <resource_groups>
            <custac translate="title" module="sharan">
                <group>sharan</group>
                <title>Abandoned Cart</title>
                <sort_order>10</sort_order>
            </custac>
        </resource_groups>

        <resources>
            <custac translate="title" module="sharan">
                <group>custac</group>
                <model>sharan/api2_restapi</model>
                <title>Abandoned cart info</title>
                <sort_order>2</sort_order>
                <privileges>
                    <admin>
                        <create>1</create>
                        <retrieve>1</retrieve>
                        <delete>1</delete>
                    </admin>
                </privileges>
                <routes>
                    <route>
                        <route>abcart</route>
                        <action_type>entity</action_type>
                    </route>
                </routes>
                <versions>1</versions>
            </custac>
        </resources>
    </api2>
</config>

Model file - Api2_Restapi

<?php
class Ziffity_Sharan_Model_Api2_Restapi extends Mage_Api2_Model_Resource{
    public function _retrieve(){
        return json_encode(array("value"=>"Hello World"));
    }
}///end of class//
?>

V1.php file

<?php
class Ziffity_Sharan_Model_Api2_Rest_V1 extends Ziffity_Sharan_Model_Api2_Restapi{
    public  function _retrieve(){
        return json_encode(array("value"=>"Hello World"));
    }
}
?>


texts: Magento 2 How to Add CMS Block to Email Confirmation Email

texts: In magento 1 we can add CMS blocks like this {{block type="cms/block" block_id="my_block"}}, I've tried this in Magento 2 but does not work. Is there a way of adding a CMS into an email template? For instance /vendor/magento/module-sales/view/frontend/email/order_new.html


texts: Load fields based on selected option in add new product admin page

texts:
Hi Could someone help me with the following,

In Add new products page, I have an attribute 'code generate' with a dropdown list of values Yes, No. I need to show additional attribute fields such as 'name' and 'number of codes' if user selects Yes for the field 'code generate'.

All the additional attributes have already been created. I just want to know how to load other attributes based on Yes or No of the field 'code generate'

Thank you.


texts: Template is not displaying in tab of my custom module

texts:
I have an admin custom module in which there are three tabs present. First tab is use to collect basic informations of the module and second one is used for avanced information collection.

I want some of the content portions render with a template file and rest of the content render with the tab file itself in my second tab. Here is my second tab file

<?php
class Electronicsstore_News_Block_Adminhtml_News_Edit_Tab_Advance extends Mage_Adminhtml_Block_Widget_Form
{
    public function __construct()
  {

        $this->setTemplate('news/calendar/calendar.phtml');//use to render calander field
        parent::__construct();
  }

  protected function _prepareForm()
  {
    $news = new Varien_Data_Form();
    $this->setForm($news);
    $fieldset = $news->addFieldset('news_advance',  array('legend'=>Mage::helper('news')->__('Advanced Settings')));

   //use to add date; need to add start and final days in this module
    $fieldset->addField('news_stime', 'time', array(
          'label'     => Mage::helper('news')->__('Start Date'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'title',
          'onclick' => "",
          'onchange' => "",
          'value'  => '12,04,15',
          'disabled' => false,
          'readonly' => false,
          'after_element_html' => 'Comments',
          'tabindex' => 1
    ));
    $fieldset->addField('news_ltime', 'time', array(
          'label'     => Mage::helper('news')->__('End Date'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'title',
          'onclick' => "",
          'onchange' => "",
          'value'  => '12,04,15',
          'disabled' => false,
          'readonly' => false,
          'after_element_html' => 'Comments',
          'tabindex' => 1
    ));
}
}

so I want render the calendar template first and then it should followed by those time fields which I have set through the method _prepareform() in my second tab's content section. Currently it is not working together. I didn't get the template file output in my tab. Is it possible in magento?
Please enlighten me with good ideas. Thanks in advance


texts: Magento 2: How to add optgroup to select dropdown

texts:
In my ui-select fields I want to sort my options by different optgroups like:

Source model location is Vendor/Model/Source/Model.php and it has the function for options as below

public function getAllOptions()
{
    if (empty($this->options)) {
        $options = [];
        $searchCriteria = $this->searchCriteriaBuilder->create();
        $searchResults = $this->ghscategoryRepository->getList($searchCriteria);
        foreach ($searchResults->getItems() as $ghscategory) {
            $options[] = [
                'value' => $ghscategory->getGhscategoryId(),
                'label' => $ghscategory->getGhs_category_code(),
            ];
        }
        $this->options = $options;
    }

    return $this->options;
}

Can I edit the options array and add optgroups?

If not here, which file/files I have to edit to add my optgroups?


texts: How to make a module layout to be shown on all themes

texts:
Here is the situation: I have several self made modules, all tested and working using the default theme. Then we bought and installed a new theme. Switched to the new theme and the modules are not shown. After several try/fail tests I found that I needed to copy the corresponding layout and template files to the corresponding folders of the recently installed theme.

So, my question is: what should I do in order to get all my modules working with any theme installed after the module setup?


texts: Newsletter tab in admin backend disappeared after upgrade from 1.6 to 1.8.1

texts:
I've recently upgraded a site from 1.6 and I've had some minor issues which I've mostly resolved now. My final hurdle is the newsletter tab which have mysteriously disappeared.

Any idea why it's gone and (even better) any ideas on how to get it back?

Even just suggestions on how to debug this issue would be appreciated.

Update:
I've experimented with creating a new user and giving this user a new role with only access to the Newsletter pages. Once I log in with this user I'm taken to one of the pages I have access to. I have toggled each newsletter page on and off and logged in and out for each to verify that all the pages work; and they do. The menu is still missing which confirms my theory that the update somehow broke the Newsletter menu entries. Any suggestions to how I can make the Newsletter tab (re-)appear?


texts: Get all products that have a custom attribute of a value

texts:
Ive made a new product attribute called "product_price_family" in magento2 admin panel. This is a dropdown value. I have changed the value of product_price_family of 5 products to "test" in the attribute drop down.
Is it possible to programatically get all the products that have the attribute "product_price_family" value of "test" with custom SQL?


texts:
I'm updating a plugin and I need to add two fields.

I'd like to add them in checkout but also in user registration form.

I'm new to Magento, and I'm trying to do my best.

I found a guide here: https://oyenetwork.com/articles/magento2-devliery-date-module-creation-from-scratch/

So I begin to add the new columns to my database,

in this way:

public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $installer = $setup;
    $setup->startSetup();

    $installer->getConnection()->addColumn(
        $installer->getTable('quote'),
        'codice_destinatario',
        [
            'type' => 'text',
            'nullable' => false,
        ]
    );

    $installer->getConnection()->addColumn(
        $installer->getTable('quote'),
        'pec',
        [
            'type' => 'text',
            'nullable' => false,
        ]
    );

    $installer->getConnection()->addColumn(
        $installer->getTable('sales_order'),
        'codice_destinatario',
        [
            'type' => 'text',
            'nullable' => false,
        ]
    );

    $installer->getConnection()->addColumn(
        $installer->getTable('sales_order'),
        'pec',
        [
            'type' => 'text',
            'nullable' => false,
        ]
    );

    $installer->getConnection()->addColumn(
        $installer->getTable('sales_order_grid'),
        'codice_destinatario',
        [
            'type' => 'text',
            'nullable' => false,
        ]
    );
    $installer->getConnection()->addColumn(
        $installer->getTable('sales_order'),
        'pec',
        [
            'type' => 'text',
            'nullable' => false,
        ]
    );

    $setup->endSetup();
}

At the moment I'm not able to show my new fields in checkout.
Thanks
David


texts: Magento 2: How to set the radio option value programatically (by variable) in admin panel

texts:
I want to set the radio box option value from the variable as below example.

How can i achieve this.

$fieldset->addField(
            'test',
            'radios',
            [
                'label' => __('test'),
                'title' => __('test'),
                'name' => 'test',
                'required' => true,
                'values' => array(
                        array('value'=>'male','label'=>'Male'),
                        array('value'=>'female','label'=>'Female'),
                   )
            ]
        );

Here i want to set the attribute checked="checked" if condition is true or $selected has particular value.

Is it possible in admin panel?


texts: Magento1: add extra 2 field to customer registration for fronted ,admin , and database

texts: I followed several tutorials like   https://marketplace.magento.com/  followed the step but no luck for me. how to add 2 extra field in customer or user registration for frontend ,admin and database . any help would be appreciated.


texts: magento 2 override block using preference

texts:
I need help regarding block overriding.
I have successfully overridden a block using preferences, but when I add core registry in the construct method it's showing the following error:

Recoverable Error: Argument 2 passed to Magento\Catalog\Block\Product\ProductList\Toolbar::__construct() must be an instance of Magento\Catalog\Model\Session, array

This is my code:

namespace Vendername\Modulename\Block;

use Magento\Framework\View\Element\Template;
use Magento\Framework\Registry;

class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar
{

    protected $_registry;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        Registry $registry,
        array $data = []
    ) {

        $this->_registry = $registry;
        parent::__construct($context, $data);
    }

    public function getCurrentMode()
    {

        $category = $this->_registry->registry('current_category');
        print_r($category->getId());
        exit;
        $mode = $this->_getData('_current_grid_mode');
        if ($mode) {
            return $mode;
        }
        $defaultMode = $this->_productListHelper->getDefaultViewMode($this->getModes());
        $mode = $this->_toolbarModel->getMode();
        if (!$mode || !isset($this->_availableMode[$mode])) {
            $mode = $defaultMode;
        }
        $this->setData('_current_grid_mode', $mode);
        return $mode;
    }
}

If I remove registry and this line, override is working.


texts: Where to place constants and/or module specific configuration

texts:
I have a module that needs smtp authentication information (host, email, method, password, port). I don't want to just hard code this. Where can I put this information where it will have some independence from the code.

For instance, if I wanted to make a JSON that holds this data, where would I place this file in the module structure?


texts: Which function calls when "Save and continue Edit" click on Add Product Page

texts: I want to know the file and location of function which works on click of "Save and continue Edit". And how i change redirect url in that function.


texts:
We have recently set up a magento community site running 1.9.0.1 having moved from go.

We are trying to set up the google adwords conversion tracking, there is a piece of code that they want placing on the success page.

Where is this located in 1.9.0.1?


texts: I want to show customer reviews of product on category page.How can i do? please help


texts: Call to a member function getValue() on null in AbstractType when loading cart

texts:
I have a simple product with a configuration option. The SKU of my product is configurator and the SKU of the options is configuration. The configuration option is a string field.

To add the product to my cart I use the following code.

$product = $this->getProductBySku('configurator');
$option = $this->getOptionBySku($product, 'configuration');
$product->addCustomOption('option_ids', $option->getData('option_id'));
$product->addCustomOption('option_1', $this->fetchConfigCode());

$this->cart->addProduct($product, [
     'product_id' => $product->getId(),
     'qty' => 1,
]);

$this->cart->save();

When I dump($this->cart->getItems()), I can just see my product living in my cart just fine. But after I reload and something reads from the cart, it throws the following error.

Uncaught Error: Call to a member function getValue() on null in /var/www/html/vendor/magento/module-catalog/Model/Product/Type/AbstractType.php:819
Stack trace:
#0 /var/www/html/vendor/magento/module-catalog/Model/Product/Type/AbstractType.php(790): Magento\Catalog\Model\Product\Type\AbstractType->getOptionSku(Object(Magento\Catalog\Model\Product\Interceptor), 'configurator')
#1 /var/www/html/vendor/magento/module-catalog/Model/Product.php(1931): Magento\Catalog\Model\Product\Type\AbstractType->getSku(Object(Magento\Catalog\Model\Product\Interceptor))
#2 /var/www/html/vendor/magento/module-quote/Model/Quote/Item.php(431): Magento\Catalog\Model\Product->getSku()
#3 /var/www/html/vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php(274): Magento\Quote\Model\Quote\Item->setProduct(Object(Magento\Catalog\Model\Product\Interceptor))
#4 /var/www/html/vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php(204): Magento\Quote\Model\ResourceModel\Quote\Item\Collection->_assignPr in

Deleting the session (thus emptying the cart) removes the error again, until I add the product again.

Is this a bug in Magento? Did I add my product incorrectly?


texts:
I am new to Magento, I have already build website and I need to do some imrovements on it.

I want to create custom minicart on my website's header. What would be the approach to do this


texts: Magento 2.3.2 required Product option value add to cart directly in category page

texts:
i have use custom option in xyz product and my product option is required in admin i want to when select in category page and add to cart directly without going to product page.

when i have remove required field in admin and it working correctly in category page

Below Working Code..

<?php
$object_manager = \Magento\Framework\App\ObjectManager::getInstance();
$custom_options = $object_manager->get('Magento\Catalog\Model\Product\Option')->getProductOptionCollection($_product);
if (is_array($custom_options) && count($custom_options) > 0) {
    echo '<input type="hidden" name="selected_configurable_option" value="">';
}
foreach ($custom_options as $option) {
    $values = $option->getValues();
    if (is_array($values) && count($values) > 0) { ?>
        <div class="form-group">
            <select name="options[<?php echo $option->getOptionId(); ?>]" class="required product-custom-option admin__control-select form-control" title="" data-selector="options[1]" aria-required="true">
                <?php foreach ($values as $index => $value) { ?>
                    <?php if ($index === 0) { ?>
                        <option value="" selected>-- Please Select --</option>
                    <?php } else { ?>
                        <option value="<?php echo $value->getOptionTypeId(); ?>" price="<?php echo $value->getPrice(); ?>"><?php echo $value->getTitle(); ?></option>
                    <?php } ?>
                <?php } ?>
            </select>
        </div>
    <?php } ?>
<?php } ?>

product option showing like