texts:
I have been getting this error in my log for a while, the code is just below. Can anyone explain to me what happens at (line 27 ) $allowed_method_codes ? Specifically in get getActiveMethods(Mage::app()->getStore($store_code)->getId()). Whats it looking for in getStore? Why is there a variable in there? Thanks for any help.

ERR (3): Notice: Undefined variable: store_code in Paymenttype/Model/Observer.php on line 27

    $geoip_currency = $geoipHelper->getCookie('currency_code');
    if( $geoip_currency =='USD') {
        $store_code = 'default';
    }
    if( $geoip_currency =='CAD') {
        $store_code = 'canada';
    }

$allowed_method_codes = array_keys(Mage::getModel('payment/config')->getActiveMethods(Mage::app()->getStore($store_code)->getId()));

Loooks like it works perfectly.


texts: Magento 2: Set Product Attribute Dynamically

texts:
How to set product attribute dynamically, I am using catalog_product_save_after event and catch the event using Observer.

here is my observer

<?php

namespace Learning\HelloPage\Observer;

use Magento\Framework\Event\ObserverInterface;

class Productsaveafter implements ObserverInterface
{

    protected $_objectManager;

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_objectManager = $objectManager;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $admin_user_id = $this->authSession->getUser()->getId();
        $_product = $observer->getEvent()->getProduct();
        $_product->setAdminUserId('2');
        // $_product->setData('admin_user_id', '2');

    }
}

here is my events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_save_after">
        <observer name="product_observer" instance="Learning\HelloPage\Observer\Productsaveafter" />
    </event>
</config>

and i got this error on product save.

here is my custom attribute that is updated on product save.


texts: How to have a CSV with customer, order and shipping information since a date?

texts:
I'm running a Magento Commerce Cloud B2B, and I need to get a CSV list of these data below, the most important data to me is the client's phone number which is inside the shipping information since a date.

Order information
Client information

As I can't export a file with these pieces of information above via the admin panel, how could I do it via a MySQL query?


texts: Magento 2 Get customer ID from session in a block class

texts:
How to get customer ID from session? I tried this but not work.

protected $_customerBonusPointFactory;
protected $_customerSession;

public function __construct(Session $customerSession, \Magento\Framework\View\Element\Template\Context $context) {
    $this->_customerSession = $customerSession;
    parent::__construct($context);
}

public function _prepareLayout() {
    var_dump($this->_customerSession->getCustomer()->getId());
    exit();
    return parent::_prepareLayout();
}


texts: Tax/VAT field configuration is not working on multistore Magento2 Core

texts:
I have a multistory website as Retail-Website and Wholesale-Website

Configuration with fresh Magneto2.2 at Store >> Configuration >> Customer Configuration >> Show Tax/VAT Number

Retail-Website

Wholesale-Website

When I check the front-end of customer registration the configuration dint apply I did cache clean, I tried different combination of the setup dint work.

In Table customer_eav_attribute_website I can see the configuration is correctly added.

I tried this in version 2.2 and in 2.5 fresh project.

Scenarios 1

Admin Input

    webA >> required

    webB >> optional

Store output

    webA >> required

    webB >> required

After flush cache Store output

    webA >> optional

    webB >> optional

Scenarios 2

Admin Input

    webA >> required

    webB >> required

Store output

    webA >> required

    webB >> required

After flush cache Store output

    webA >> required

    webB >> required

Scenarios 3

Admin Input

    webA >> optional

    webB >> required

Store output

    webA >> optional

    webB >> optional

After flush cache Store output

    webA >> optional

    webB >> optional


texts:
I have imported some products with Magmi. Until 1 hour ago all work well.

Now I can't see the products on the backend!...Frontend it's ok, only on backend.

This is a PhpMyAdmin screen , and you can see all my products.

]1


texts: Magento product price not showing on catalog_product/edit page

texts:
I am inserting a simple product programmatically.

the price is displaying on the grid but not on the (admin)form when I try to edit the product price. it is displaying as zero

$new_product->setName($sortedData['description'])
                    ->setAttributeSetId(9)
                    ->setTypeId('simple')
                    ->setCreatedAt(strtotime('now'))
                    ->setWebsiteIds(array(1))
                    ->setStatus(1)
                    ->setTaxClassId(1)
                    ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
                    ->setTag($sortedData['printer_compatibility'])
                    ->setCategoryIds($category)
                    ->setSupplierCode($sortedData['dynamic_supply_code'])
                    ->setSku($sortedData['dynamic_supply_code'])
                    ->setCostExTax($sortedData['reseller_price_ex_gst'])
                    ->setManufacturer($this->fetchManufacturerOption($sortedData['manufacturer_name']))
                    ->setColor($this->addAttributeValue('color', $sortedData['cartridge_type']))
                    ->setMarkUpPercentage(10)
                    ->setPrice($this->calculatePrice($sortedData['reseller_price_ex_gst'], 10))
                    ->setCustomPrice($this->calculatePrice($sortedData['reseller_price_ex_gst'], 10))
                    ->setOriginalCustomPrice($this->calculatePrice($sortedData['reseller_price_ex_gst'], 10))
                    //->setPricePerPage()
                    ->setManufacturerCode($sortedData['manufacturer_oem_code'])
                    ->setWeight($sortedData['product_weight'])
                    //->setPageYield($sortedData['cartridge_yield'])
                    ->setPageYield($this->filterPageYield($sortedData['cartridge_yield'], $sortedData['cartridge_type']))
                    ->setMediaGallery (array('images'=>array (), 'values'=>array ()))
                    ->addImageToMediaGallery(getcwd()."/images/{$sortedData['dynamic_supply_code']}.jpg", array('image','thumbnail','small_image'), false, false)
                    ->setCubicMeasurement($sortedData['cubic_measurement'])
                    ->setStockData(array(
                                    'use_config_manage_stock' => 0, //'Use config settings' checkbox
                                    'manage_stock'=>1, //manage stock
                                    'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
                                    'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart
                                    'is_in_stock' => 1, //Stock Availability
                                    'qty' => $sortedData['stock_on_hand'] //qty
                                )
                    );

            $new_product->save();


texts:
This is my Vendor/Module/Block/BlockFile.php

<?php

namespace Vendor\Module\Block;

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

   public function getId()
  {
    return $this->getData('category_id');
  }

}

For now I'm getting category ID.

I need to get category name by ID using dependency injection.


texts: Fatal errors are coming after i run static-content:deploy with third party theme

texts:
I am facing some strange issues in Magento 2.1.3, i have configured third party theme and working fine, once i run setup:static-content:deploy, am getting fatal errors like i added below from core code. if we solve one error then it is throwing other errors.

I found same issues here MAGETWO-51440, even my code had the changes.

  Fatal error: Uncaught Error: Call to undefined method
  ReflectionParameter::isArray() in
   \vendor\magento\framework\Code\Generator\EntityAbstract.php:324

Can any one help me on this strange issue.


texts:
I have created a custom API taking help from here. Now i want to add filter to this API. Like if i want to get products filtered with some specific sku.

How can i do that?

thanks


texts: Upgrading Magento vs Applying Security Patches

texts:
We're on v1.9.1.1 of Magento which was released on May 1, 2015.  We need to install the security patches SUPEE-5994 & SUPEE-6285 which were released after this date.  But I see that v1.9.2 is out and it includes both these patches.

Am I better of just upgrading to v1.9.2 or should I just apply the patches?
What is the best way of doing this? Do I just merge v1.9.2 into my root directory and open the site in my browser?


texts:
I have on setup on Magento and i have set cronjobs as per Magento guidelines as below.

* * * * * /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

When Magento projects get some more data like more Products, categories, orders. what is the best-practice to setup the cronjob schedule?

* * * * * This will run every minute on the server.
after our Magento project is getting bigger what is the best practice to set the cron job time.

we can set the cron setting like * * * * * all the time as this will consume all your memory and CPU both

Looking for suggestions.


texts:
Magento-2.1.5 With php 5.6

issue:

PayPal checkout for existing user not working. When you say continue to PayPal keeps spinning forever. In console, I got this error

Failed to load resource: the server responded with a status of 404 (Not Found):rest/default/v1/carts/mine/selected-payment-method

Uncaught SyntaxError: Unexpected token < in JSON at position 0 /resources/checkout/#payment:1
at JSON.parse ()
at Object.process (error-processor.js:19)
at Object. (set-payment-method.js:50)
at fire (jquery.js:3099)
at Object.fireWith [as rejectWith] (jquery.js:3211)
at done (jquery.js:9312)
at XMLHttpRequest.callback (jquery.js:9720)

help should be appreciated.


texts: how to set dafault value for custom field in simple products

texts:
i'm working with magento 1.9.0.1 and be-responsive theme.I have a series of products with custom options of type radio. However I cannot set from the setup of the product the default state of that particular option.

I need at least one of the checkboxes (options) to be checked by default as the user enters the product page / adds to cart from category page.

Is this doable from the Magento administration or will it require some extra development (if so how this can be done)?


texts: There are no commands defined in the "setup" namespace : Magento 2

texts:
I have installed the latest version of Magento 2, everything is working fine frontend, backend and functionality.
I have one issue with  bin/magento setup:upgrade command, when I run this command in terminal I get below exception.

[InvalidArgumentException]
There are no commands defined in the "setup" namespace.

Screenshot:

Is there anything I missed during installation or I need to install some package to let it work?


texts: Magento 2: How can i use resource models for delete record instead of use delete method?

texts:
How can i use resource models for delete record instead of use delete method ?

Currently i used below code for delete item:

$post = $this->customCollection->load($itemId);
$post->delete();

but i need to use resource models for deleting data.

any idea please share.


texts:
Our main store has never been indexed and thus we cannot run any reports.
The stupid contractor that set this thing up was totally incompetent and did things like modify core files and didn't setup the indexing for the site so that reports could be run.

I have a staging site that is setup exactly like it, can I copy my production data to it and then run my reindex on it and then copy the DB to my production site?


texts: Is it possible to Change Container htmlClass by override Magento 2?

texts: I have a container defined in a layout file, but in some case with help of other xml I would like to change its htmlClass value, is it possible by override or something ? or need to create new container for this?


texts: Magento 2 no css/js loaded after setup:static-content:deploy

texts:
Magento is searching for files into below location,(one for example)

localhost/magento2/pub/static/frontend/Magento/luma/it_CH/mage/calendar.css

but after I run setup:static-content:deploy in pub/static/frontend. I only have en_US. I have added no other languages so I don't know why magento is looking into it_CH returning 404.


texts: How to get city value from checkout on change

texts: I want to get city name which is in drop down once the city name changed on checkout page.How i can get city name when user change city name on checkout before placing order.


texts: Magento2 How I can add autocomplete field in order grid filter section

texts: I want to add product Id field in filter section of sales order grid which is autocomplete. I have done with autocomplete but I fail to bind that new value to text-box. How we can bind custom value to filter text-box?


texts: Reset to default table sales_order_status

texts:
I need to reset 2 tables to default content:

sales_order_status
sales_order_status_state

Payment modules installed:

MercadoPago
PagSeguro

I installed these payment module and they modified the original value of the tables in field that cant change the status value.

A print with actual content:

Which command can I run on mysql to accomplish this (default content of tables?) ?

My magento version: 2.1.6.

Thanks in advance


texts:
I have some issues on Magento 2.3.5 mini cart dropdown is not appearing.
Total number of products added in cart appearing but when I click on the mini cart it shows a black transparent overlay and nothing appears.


texts: Cart not removing product from cart when payment successfully done for loggin user

texts: this is happing when i do transaction using paytm then success page not removing purchased product from cart is there any solution to solve it


texts: Magento 2.1: Price including/excluding tax

texts:
The price of my configurable product shows the price including tax like it's set in the backend. But next to it I want to display the price excluding tax. Is this possible? Because the block only holds Magento\ConfigurableProduct\Pricing\Price\FinalPrice.

Magento_Catalog/templates/product/price/amount/default.phtml

<?php /** @var \Magento\Framework\Pricing\Render\Amount $block */ ?>

<span class="price-container <?php /* @escapeNotVerified */ echo $block->getAdjustmentCssClasses() ?>"
        <?php echo $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
    <?php if ($block->getDisplayLabel()): ?>
        <?php /* @escapeNotVerified */ echo $block->getDisplayLabel(); ?>
    <?php endif; ?>
    <span <?php if ($block->getPriceId()): ?> id="<?php /* @escapeNotVerified */ echo $block->getPriceId() ?>"<?php endif;?>
        <?php echo($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
        data-price-amount="<?php /* @escapeNotVerified */ echo $block->getDisplayValue(); ?>"
        data-price-type="<?php /* @escapeNotVerified */ echo $block->getPriceType(); ?>"
        class="price-wrapper <?php /* @escapeNotVerified */ echo $block->getPriceWrapperCss(); ?>"
        <?php echo $block->getSchema() ? ' itemprop="price"' : '' ?>>
        <?php /* @escapeNotVerified */ echo $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?>

    <?php if ($block->hasAdjustmentsHtml()): ?>
        <?php echo $block->getAdjustmentsHtml() ?>
    <?php endif; ?>
    <?php if ($block->getSchema()): ?>
        <meta itemprop="priceCurrency" content="<?php /* @escapeNotVerified */ echo $block->getDisplayCurrencyCode()?>" />
    <?php endif; ?>


texts: Magento 2 - Change theme based on IP programmatically

texts:
Have tried to find a solution for this but can't find one anywhere.

I need to change the theme for a visitor based on their IP.

Any one have a clue where I can look?

(I'm trying to avoid the store front way - as the theme switch is only a temporary thing)

Thanks


texts: Issues with the `sales_order_item_cancel` event in Magento 2.4.1

texts:
I have made an API which cancel and order. This is part of the code:
// \Magento\Sales\Api\OrderManagementInterface
$this->orderManagement->cancel($order->getId());

The above code will called this method: \Magento\Sales\Model\Order\Item::cancel,
where this event is dispatched:             $this->_eventManager->dispatch('sales_order_item_cancel', ['item' => $this]);
The event is used by: \Magento\CatalogInventory\Observer\CancelOrderItemObserver::execute
with the following code:
/**
 * Cancel order item
 *
 * @param   EventObserver $observer
 * @return  void
 */
public function execute(EventObserver $observer)
{
    /** @var \Magento\Sales\Model\Order\Item $item */
    $item = $observer->getEvent()->getItem();
    $children = $item->getChildrenItems();
    $qty = $item->getQtyOrdered() - max($item->getQtyShipped(), $item->getQtyInvoiced()) - $item->getQtyCanceled();
    if ($item->getId() && $item->getProductId() && empty($children) && $qty && $this->configuration->getCanBackInStock()) {
        $this->stockManagement->backItemQty($item->getProductId(), $qty, $item->getStore()->getWebsiteId());
    }
    $this->priceIndexer->reindexRow($item->getProductId());
}

My problem is that the canceling the order takes too much time, on my local it takes almost 3 minutes. IF I comment the following lines:
 $this->stockManagement->backItemQty($item->getProductId(), $qty, $item->getStore()->getWebsiteId());

and
$this->priceIndexer->reindexRow($item->getProductId());

from the observer, the all canceling process it takes 3 seconds!. The fact is, if I cancel the order from the admin area, the results are the same! so the problem is not from my custom API!
Have anyone faced something like this? If YES, what can I do the reduce the execution time? 3 minutes(on my local and 1 min 30 seconds aprox. on live) is not acceptable!


texts: Magento 2 : After deleting the pub/static/frontend folder everything collapsed

texts:
When I delete the pub/static/frontend or backend folder, everything falls on the frontend and backend, and every time I need  to call static-content: deploy for everything to work fine. Using developer mode

why can help me ?


texts: Magento2: Bulk Import Products section; adding a new custom user_id selection Drop down

texts:
I need to add a dropdown for showing user list against which I will upload bulk products.
the dropdown should appear when the admin selects Product upload from first dropdown.
Please guide me how can I achieve this?


texts: Magento 2.3 images cache generation generates wrong hash for some images with a custom theme

texts:
I just upgrade my Magento 2 project from 2.2.6 to 2.3. After the upgrade, some images in the catalog are showing placeholders instead of the images. I have regenerated the images cache with the catalog:images:resize but some images are still missing (swatch images in category pages and image thumbnail in category pages).

https://github.com/magento/magento2/issues/19710


texts: How to edit the text on the checkout in Magento (step 4. Payment Information)

texts:
How do I edit the text found in this box?
The company that set up our website set it up with PayPal Standard Payments - where if the customer wants to pay by credit or debit card they go to PayPal's website.
PayPal are phasing out the 'Guest Checkout' facility on this so only half our customers are getting the option to pay via credit or debit card.

I want to flick it over to PayPal Website Payments Pro (Hosted Solution) but need to remove the visa mastercard logo they added in plus the small sentence.


texts: During magento 2 import How to import some data from csv to custom table?

texts:
During the magento product import some of the data or column in csv file need to import in my custom table.
Can anyone help me ?


texts: Very strange mysql wait after moving to different server


texts: Fire event observer when product is enabled

texts:
I want to fire event observer when products are enabled from admin, I can not find any event for this please help on this.
I want to do below things

Once the product is enabled or disabled need to mail admin.
I want to do it from the Observer or any other method.

Please help!


texts: Delete Newsletters out of queue in admin panal

texts: Help! Can someone please tell me how to delete unsent newsletters out of the admin panel in Magento? I want to get rid of all of these except the one that is sent. Thanks much.


texts: How to list only enabled product in backend order in magento 2?

texts:
In magento 2, from backend trying to place order but while selecting product from product grid it is including enable and disable product.

But i want to list only enabled product from grid.

For more deatils attaching screen-shot.


texts:
I'm trying to create some newsletter emails using magentos transaction email system but I've run into situation where when I save the template it cuts off the email at a certain point. Because of the nature of coding everythin in tables and inline css the html is quite large and for one particular email it is 79,000 characters and its getting cut off at around 65,000. So my question is: Is there a limit to the size of email templates and if so can it be changed??

Thanks in advance


texts: How to import multiple images for a single SKU

texts:
According to M2 Docs:

  If importing multiple images for a single sku, insert a blank row below the sku, and enter the additional image file names in the appropriate columns. The additional rows are understood to belong to the parent sku.

But, when I try to do this I get an error:

This is my import:

The import appears to be treating my "additional rows" as different products and failing validation. What am I doing wrong?


texts: Error depending with fileuploader on text field validation while saving category in BO

texts:
I've got an error on category saving in BO:

  Warning: ltrim() expects parameter 1 to be string, array given in vendor/magento/module-catalog/Model/Category/FileInfo.php on line 102

Have simple text field, attached validation by unique value on it and fileUploader field, where exists uploaded image.
Error appears only after validation failed. Fields added to category form via ui component.

Fields config:

    <field name="code">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">10</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="dataType" xsi:type="string">varchar</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">category</item>
                <item name="label" translate="true" xsi:type="string">Code</item>
                <item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
                <item name="notice" xsi:type="string">Unique code of category (do not change)</item>
            </item>
        </argument>
    </field>
    <field name="header_background">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">string</item>
                <item name="source" xsi:type="string">category</item>
                <item name="label" xsi:type="string" translate="true">Header Background</item>
                <item name="formElement" xsi:type="string">fileUploader</item>
                <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
                <item name="sortOrder" xsi:type="number">20</item>
                <item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
                <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="url" path="catalog/category_image/upload"/>
                </item>
            </item>
        </argument>
    </field>

Made debuging category saving process. Found, that when I comment out fetching category from magento register (vendor/magento/module-catalog/Model/Category/DataProvider.php lines 411 - 414), then saving category runs ok.

Did anyone knows how I can fix it?

Thanks in advance.


texts: How to write this Curl code to Magento 2 code?

texts:
I am calling third party API using below methods:

public function setCredentials($data)
{

    $curl = curl_init('https://example_url.com/');
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec($curl);
    curl_close($curl);
}

i have tried some of the examples here but I still get errors. How to curl in magento 2?


texts: Console showing Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block:

texts:
I don't know what it's means and how to remove this error.

it's showing in my chrome console . but not in firefox console..

  (index):1 Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block: expected semicolon at character position 13. The default protections will be applied.

Here's Response header

Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Date: Tue, 19 Jun 2018 07:27:16 GMT
Expires: Mon, 19 Jun 2017 07:27:19 GMT
Keep-Alive: timeout=5, max=100
Pragma: no-cache
Server: Apache
Set-Cookie: PHPSESSID=0ean77aq28m84hsbfm1fg71996; expires=Tue, 19-Jun-2018 08:27:19 GMT; Max-Age=3600; path=/ritz; domain=mydomain.com; HttpOnly
Set-Cookie: form_key=BiFqDSvrvVRBd7jn; expires=Tue, 19-Jun-2018 08:27:19 GMT; Max-Age=3600; path=/mydirectory; domain=mydomain.com
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block

Request header

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Authorization: Basic dGVzdDptaWRhc0AxMjM=
Cache-Control: max-age=0
Connection: keep-alive
Cookie: PHPSESSID=0ean77aq28m84hsbfm1fg71996; mage-translation-storage=%7B%7D; mage-translation-file-version=%7B%7D; form_key=BiFqDSvrvVRBd7jn; store=default; mage-cache-storage=%7B%7D; mage-cache-storage-section-invalidation=%7B%7D; mage-cache-sessid=true; mage-messages=; recently_viewed_product=%7B%7D; recently_viewed_product_previous=%7B%7D; recently_compared_product=%7B%7D; recently_compared_product_previous=%7B%7D; product_data_storage=%7B%7D; private_content_version=fcad1216f3986344d5a56dd2b60c1c29; section_data_ids=%7B%22directory-data%22%3A1529391306%2C%22cart%22%3A1529392350%7D
DNT: 1
Host: mydomain.com
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36


texts: Programatically incremenet and decrement cart item quantity in magento 2?

texts: Programatically incremenet and decrement cart item quantity in magento 2.


texts: Creating a B2B Marketplace(Multiple Sellers) with Headless Magento

texts:
I'm currently working on a Project where we do analysis a specific Product type. We now want to extend this site with a B2B Marketplace that lets customers create a Tender of their products and put them on the marketplace for sale for other customers to buy.
I was wondering if something like this would be possible with magento and if it is a good use-case for it?
I already started reading the developer documentation and most of the time they are referring to one "admin"/"seller" user. But for my case I need to be able to create multiple sellers that are also buyers at the same time.


texts: Why magento2 Layered Navigation Price slider starts with Zero?

texts: We are running Magento2.2.7. When we go to PLP, the price slider navigation starts with Zero. Even when we click/select a range of 0-0 , still it shows some products.


texts: Magento Custom Modules disable cannot show default information

texts:
I have create a new magento website and only installed one plugin.
Magemaven_ordercomment

It is working in sales/order page, it is showing the order information with order comment.

However, when I disable the modules in system configuration, and go to  sales/order page,
the page cannot display any information, it cannot show the grid.

I know when I change the coding on etc/modules to false can show back the default information
But this method is not the good way to manage the system
Would it have any other method to fix it?

When enable the modules:
it added a columns for showing comment

https://www.dropbox.com/s/zepgzwlvi4ap8jl/Screenshot%202014-04-11%2014.15.57.png

When disable the modules:
https://www.dropbox.com/s/btmcy8mb5c1e0az/Screenshot%202014-04-11%2014.15.19.png

class Magemaven_OrderComment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid{
    /**
     * Retrieve collection class
     *
     * @return string
     */
     protected function _getCollectionClass()
    {
        return 'ordercomment/order_grid_collection';
    }

/**
 * Prepare grid columns
 *
 * @return Magemaven_OrderComment_Block_Adminhtml_Sales_Order_Grid
 */
protected function _prepareColumns()
{
    parent::_prepareColumns();

    // Add order comment to grid
    $this->addColumn('ordercomment', array(
        'header' => Mage::helper('ordercomment')->__('Order Comment'),
        'index' => 'ordercomment',
    ));

    return $this;
}

}

when i disable the modules, the page cannot show the grid because  parent::_prepareColumns(); cannot run ?


texts: CRUD Module - Add Preview Link to Edit View of Uploaded Media

texts:
I have created a module to upload PDFs, its a basic CRUD module.

My question is, how can I add a link to the Edit view so that the user can preview the media that is attached to the row being edited?


texts:
I have 26,313 products on my magento website thats according to my categories page

but for some reason it shows me having 4126 products on the manage products page

I have all together 407 configurable products and the rest are simple products, but for some reason only 184 configurable products are shown on the front, and i've checked the stock levels, status, category, etc can magento handle this many products ?


texts: How to export CMS Page data in Magento 2

texts:
I have added a custom attribute to CMS Page in magento 2. Can anyone please guide me How can I Export the value of that attribute of each CMS page through Custom Module?

Thanks


texts:
How can we create this below in RMA
Categories Name       Exchange Days      Replacement Days         Return Days     Non Returnable
Clothing                  10                    0                       10             -
Electronics               0                     7                        0             -
Footwear                  9                     0                        9             -
Medical Items             0                     0                        0            yes

According to above setting by admin, Customer will be only able to see in product page in front end and also customer can only request for RMA Resolution as per above setting by admin.


texts: Emails are not going to repective email address Magento 1.9

texts:
I am using Magento 1.9.2.1. I have created one custom form using CMS page.when the form will submit it will send email to respective customer. so i have tried below code to achieve that:

  controller.php

<?php

class Shasha_CorporateAccount_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        if ($data = $this->getRequest()->getPost())
        {
            //echo '
';print_r($data);die;
            try
            {
            $msg_html=  "
";
                $msg_html.= "
Name	".$_POST['first_name']." ".$_POST['last_name']."
";
                $msg_html.= "
Email	".$_POST['email']."
";
                $msg_html.= "
Phone	".$_POST['phone']."
";
                $msg_html.= "
Company	".$_POST['company']."
";
                ///$msg_html.=  "
Note
".$_POST['comment']."
";
                $msg_html.= "
";

                $to_email = "shasha@gmail.com";
                $to_name  = "Shasha";
                $subject  = 'Corporate Account Request';
                $Body     = $msg_html;
                $sender_email = $_POST['email'];
                $sender_name = $_POST['first_name'];

                //Sending E-Mail to Customers.
                $mail1 = Mage::getModel('core/email')
                ->setToName($to_name)
                ->setToEmail($to_email)
                ->setBody($Body)
                ->setSubject('Subject :'.$subject)
                ->setFromEmail($sender_email)
                ->setFromName($sender_name)
                ->setType('html');
                try{
                //Confimation E-Mail Send
                $mail1->send();

                }
                catch(Exception $error)
                {
                Mage::getSingleton('core/session')->addError($error->getMessage());

                }

                $message = $this->__('Thank you for the request, Will get back to you asap.');
                Mage::getSingleton('core/session')->addSuccess($message);
                $this->_redirectReferer();
                return;
            } catch (Exception $e) {
                $message = $this->__('Error to send request.');
                Mage::getSingleton('core/session')->addError($message);
                //$this->_redirect();
                $this->_redirectReferer();
                return;
            }

        }

    }

}
?>

if i put this code

if($mail1->send()){
   die(Email is sent successfully);
}

in this response i also get Email is sent successfully but unfortunately customer is not getting any email.

I am unable to find out the correct solution.

Please if anyone can help me on this.

Thanks in advance...!!!


texts: I am using Magento 1.9.1. I want to modify email-inline.css with some custom styles for a particular transactional email.  I have created email-inline.css in my theme, but when I preview the email, only the styles in the original email-inline.css are used.  If I create a new file email-inline1.css in the base directory, and refer to it specifically in the email template, it will pick that up, but it seems not to bother looking in my theme folder.  Am I doing something wrong??  I don't want to have to specify all the styles in each email.


texts: Magento 1.9: Skip Shipping Method for all countrries

texts: I don't want to show the shipping method in the checkout page if customer select any country then shipping method does not change its only show the default value or anything I don't want to charge the customer for shipping


texts: WYSIWYG image upload works but product image upload does not - Community 1.7.0.2

texts:
I've encountered a strange issue since moving our Magento installation to a new server.

While attempting to upload images for a new product it just seems to hang with the upload never completing:

If I try to switch tabs a dialog pops up and says there are files that aren't uploaded yet.

I can upload from the WYSIWYG editor no problem though.

I have searched for several hours to find a solution but so far nothing has worked.

I've made sure the media folder has the correct permissions.
I've tried various php.ini configurations suggested around the web.
I've tried a no-flash uploader but it still behaves the same way.

I assume it's something to do with the new server as the problem only started once we switched.

Any help is greatly appreciated.


texts:
This is the content of my controller:

<?php
class Attin_Exportdb_Adminhtml_AttributesController extends Mage_Adminhtml_Controller_Action{

    public function IndexAction() {

        $this->loadLayout();
        $this->getLayout()->getBlock("head")->setTitle($this->__("Export Attributes"));

        $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','attributes_exp_db',array('template' => 'exportdb/attributes.phtml'));
        $this->getLayout()->getBlock('content')->append($block);

        $this->renderLayout();

    }
    public function AjaxAction(){

        $model = Mage::getModel('exportdb/attrdb')->query_attr();
        echo $model;
    }
}

This is the content of my model:

<?php

class Attin_Export_Model_Attrdb extends Mage_Core_Model_Abstract
{

   public function query_attr(){
        return "Test";
   }

}

and this is the config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Attin_Exportdb>
            <version>0.1.0</version>
        </Attin_Exportdb>
    </modules>
    <global>
        <helpers>
            <exportdb>
                <class>Attin_Exportdb_Helper</class>
            </exportdb>
        </helpers>
        <blocks>
            <exportdb>
                <class>Attin_Exportdb_Block</class>
            </exportdb>
        </blocks>
        <models>
            <exportdb>
                <class>Attin_Exportdb_Model</class>
            </exportdb>
        </models>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <attin_exportdb before="Mage_Adminhtml">Attin_Exportdb_Adminhtml</attin_exportdb>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

My question in AjaxAction() function what am I doing wrong ? thx in advance


texts: theme.js and responsive.js not loading in custom theme in magento 2.1.9

texts:
I have created a custom theme,

   Thomson/
    └── book
        ├── composer.json
        ├── media
        │   └── image.png
        ├── registration.php
        └── theme.xml

After that I choose my custom theme via admin, my frontend not load correctly.

I tried, static-content deploy, clear cache, and remove <m2>/var/* files

css are calling but  theme.js and responsive.js is goes to 404.

Reference:

Error:

Frontend:

Suggest me, How to fix this..


texts: Magento 2: Multiple Select Product Attribute issue by removing all values

texts:
Go to Admin -> Stores -> Attribute -> Product -> Product Attributes.

Create Attribute as shown in Image.

Assign this Attribute to your Attribute Set. Create Product by selecting all Values. Test 1, Test 2, Test 3.

Update product by removing all values. It will not work. If you remove Test 2 & Tests 3. Then it will store Test 1.

It works fine for 1 Option. But if you want to remove all 3 of them, then it won't work.

Alternative would be to create "Select" as Option & assign

Values will be stored in catalog_product_entity_varchar. Check ur attribute_id from eav_attribute Table & entity_id is Product Id

https://github.com/magento/magento2/issues/4822


texts: Allow admin user to give permission to customer registration in Magento shop

texts:
I want to set a rule to allow administrator to give permission to customers when they register an account in the Magento Shop. Currently, Customers can register an account without asking Administrator's permission.

Anyone here knows about how to do it or any extensions I can use for this purpose?


texts: Customer multiselect attribute selections not saving - Magento 2

texts:
I have successfully added a multiselect attribute to the adminhtml customer edit form, but when saving the customer the selected values are not saved.

$customerSetup->addAttribute(Customer::ENTITY, 'customattribute', [
    'type' => 'text',
    'label' => 'Custom Attribute',
    'input' => 'multiselect',
    'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
    'source' => 'My\Module\Model\Config\Source\CustomOptions',
    'required' => false,
    'visible' => true,
    'user_defined' => true,
    'sort_order' => 1000,
    'position' => 1000,
    'system' => 0,
]);

EDIT:

The source class:

class PortalCategoryOptions extends AbstractSource {
    protected $_categoryHelper;

    protected $_categoryCollectionFactory;

    public function __construct(Category $catalogCategory, CollectionFactory $categoryCollectionFactory) {
        $this->_categoryHelper = $catalogCategory;
        $this->_categoryCollectionFactory = $categoryCollectionFactory;
    }

    public function getStoreCategories($sorted = false, $asCollection = false, $toLoad = true) {
        $collection = $this->_categoryCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->setOrder('name');

        return $collection;
    }

    public function getAllOptions() {
        $arr = $this->toArray();
        $ret = [];

        foreach ($arr as $key => $value)  {
            $ret[] = [
                'value' => $key,
                'label' => $value
            ];
        }

        return $ret;
    }

    public function toArray() {
        $categories = $this->getStoreCategories(true,false,true);

        $categoryList = array();
        foreach ($categories as $category){
            if ($category->getEntityId() >= 3) {
                $categoryList[$category->getEntityId()] = __($category->getName());
            }
        }

        return $categoryList;
    }
}


texts:
i have added custom slider with for products. I added Jquery files. When I add jQuery files in XML then slider working but Add to Cart Button not working. When I remove jQuery files then, Slider obviously not working but Add to Cart button working Properly. Please Guide me I'm sharing link of my site:

t1.mygarden.pk


texts: Retrieving product's price including tax

texts:
I'm writing a custom .phtml file for a CMS page, in which a list of products is shown with the price of the item, including GST (10%). I've got the items and the prices being output to a table, yet I can't get the tax-inclusive price.

I've read all over the internet that there's two main ways to get tax-inclusive prices:

Mage::helper('core')->currency($product->getFinalPrice())

Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), 2)

Yet trying both of these, all I can get is the ex-GST amount. Tax is set up, and shows on catalog pages, yet no matter what I do I can't get it to show on a CMS page. The code below is what I have on my page, and you can see I've been trying all sorts of combinations with getPrice, getFinalPrice, etc, but it just won't print anything except the exclusive price. Any suggestions would be great.

function construct($catID) {
 /* load product collection */
    $categoryId = Mage::getModel('catalog/category')->load($catID);
    $products = Mage::getModel('catalog/product')->getCollection();
    $products->addCategoryFilter($categoryId)->addAttributeToSelect(array('sku','name','price'))->load();
    ?>
    <div class="productTable" id="<?php echo $categoryId->getName(); ?>">
      <?php echo "
".$categoryId->getName()."
"; ?>

          Product Name
          Price

        <?php
        foreach ($products as $product) {
          $name = $product->getName();
          $sku = $product->getSku();
          $price = Mage::helper('core')->currency($product->getFinalPrice());
          ?>

            <?php echo $name; ?>

              <?php echo Mage::helper('core')->currency($product->getFinalPrice()); ?>
              <?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), 4);?>
              <?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), true);?>
              <?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), false);?>
              <?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice());?>
              <?php echo $product->getFinalPrice();?>

          <?php
        }
        echo "

";
      } /* end construct */

  $cpuID = 22;
  $memoryID = 23;
  $gpuID = 27;
  $caseID = 19;

  construct($cpuID);
  construct($memoryID);
  construct($gpuID);
  construct($caseID);

  ?>


texts: When should I create an invoice, and what capture method should I use?

texts:
Currently, the workflow we have is as follows:

1.Client app clicks on checkout.

2.Turn quote into an order, and clear/deactivate quote. Set order as pending.

3.The app/user is then forwarded to third party payment gateway, where they'll enter their credentials.

4.The third party does a callback to our server, returning if the user has successfully paid the amount, as well as the increment order Id.

5.Upon success, create an invoice for the order and set as paid.

My question is, is this a correct workflow? Or should I create an invoice upon order creation? And what do I set the invoice capture option as? Offline or Online?


texts: magento 2 send data or variable from the controller to phtml template file directly in custom module?

texts:
Tried every thing to send data but not work. In the index controller what can i use to send the data to template file.

public function execute()
{
    /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
    $this->_view->loadLayout();

    $post = $this->getRequest()->getPostValue();
    $we =  $this->getRequest()->getParams();

   // echo "<pre>";print_r($we);
     if(!empty($we['ripple_email'])){
        $register_email= $we['ripple_email'];
        if(!class_exists('afclass'))
        include_once 'afclass.php';
        // $curl_info = new afclass;
        $asset_id = Afclass::before_registration($register_email);
        $value =225;
        $block = $this->_view->getLayout()->createBlock('module\Block\Adminhtml\CustomBlock');

        $block->setFeedback($value);

     }

  $this->_view->renderLayout();
}

}


texts: 'Mage_News_Helper_Data' not found in magento

texts:
Fatal Error :Mage_News_Helper_Data' not found in magento
  directory/app/Mage.php on line 547

I created a new module for mage_news, eventhougth it shows the error.
What do I have to do?


texts: New Magento install: Your current session has been expired

texts:
Did a new Magento 2.1.1 CE install on a Hosted environment. All went well until the login into the Admin page.
I get the message:

  Your current session has been expired!

I tried several things. Like emptying the var/cash files and even the var/session files put in my .htaccess the lines:

php_value session.gc_maxlifetime 86400
php_value session.cookie_lifetime 86400

Not working. When I look into the php settings I can see that these are (0) so the 86400 are not applied by the server (they do not provide such services for hosted sites).

Now what can I do to get into the back-end? I asked the provider to change the settings but I am not sure they are willing to do that. So is there another solution to get into the admin page?


texts: Magento 1.9 : Partial Update stock quantity with dataflow

texts:
The question is simple.

Using "Import Dataflow" to update stock quantity, can i use a csv file where are presents only the product I want to update?

I mean I have 300 products in my store.

If I want to update stock quantity only of 50 of them, can I use a csv with that 50 products information? Or I have anyway use a 300 lines file?

I can't experiment this cause the site in running, so if I loose all the products it will be a mess for me.

Thank u for helping


texts: Multi language store view - Review stars is not visible on product page

texts: When switching to other languages the review stars is not working. How can I resolve this?


texts:
I am trying to create a module for toggling visibility of a sort of welcome announcement or special features announcement banner at the top of the screen on a Magento site (1.7.0.2). I want to be able to toggle the visibility / presence of this banner via a UI element in the backend.

I don't want to have to edit my static blocks (beyond set-up), nor have to have the store owner navigate the backend to disable / enable, beyond a menu item or similar simple UI. Does Magento have any built-in mechanism to allow for this sort of UI control?

Here's some code snippets:

In the CMS, I created a static block with title "Header Hello Block" and id "header_hello_block", which looks like this:

Hello, world!

and in my app/design/frontend/default/themename/layout/page.xml I've entered the following, just after the html_header:

        <block type="cms/block" name="header_hello_block" before="-">
            <action method="setBlockId">
                <block_id>header_hello_block</block_id>
            </action>
        </block>

According to this article, that's all I should need to do in order to see my block rendered. What am I missing?


texts: Magento 2.2 : MySQL General error 1787 when reindexing

texts:
How to fix the two errors below ?

$ php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index is locked by another reindex process. Skipping.
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
SQLSTATE[HY000]: General error: 1787 When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1., query was: CREATE TEMPORARY TABLE IF NOT EXISTS `catalog_product_index_eav_temp` LIKE `catalog_product_index_eav_tmp`
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:04

My server in on Ubuntu 16.04 with Mysql 5.7.19 and php 7.0.24.


texts: Magento2 - How to enlarge the catalog single product image?

texts: How to Enlarge the catalog single product image in Magento2


texts:
/var/www/app/code/local/Lpf/ModuleUrlBackAfterLogin/controllers/AccountController.php

Mage::getSingleton('customer/session')->addNotice('Your account needs to be approved...');

I'm looking for a way to have the above string translated in my french webstore.

I have set that string in /var/www/app/locale/fr_FR/Mage_Customer.csv, but the web site keeps displaying the English version.


texts:
I'm using magento 1.9.

I have added some Shopping CART price rules and Catalog price rules.
Is it possible to display these products (offer products) in separate page/home page?

Are there any free extensions available for this?


texts: Magento 2 Chaning Storeview not chaning category and product url key

texts:
I have a Magento 2 store with two store views ( one english one italian ).

But, I encounter a problem when switching between store views when I'm inside a category or a product.

The Url key won't change. Does anyone know?

Thanks.


texts: Customer last logged in - Weird Date plus duplicate

texts:
I am a bit confused about some of the information which is displayed under the personal information tab whilst viewing a customer in the admin

When looking at various customers I get something like the following

But also when looking at other customers I get something like

Questions:

Why is there 2 last Logged In's
Why sometimes does it not recongised a customer has logged in
What is the weird year "2882" in the 2nd image


texts: Why the extensions are visible on frontend after disabling from admin panel

texts:
I am building the website called cravestore.in. I have disabled the pin code extension from admin panel but still it is visible on front page. I have installed this extension manually through FileZilla FTP client. How to remove this extension from frontend which is disabled in admin panel. I have cleared all the index & cache & flushed magento cache as well, but no success.
Attached are the screenshots.


texts:
Magnifier is not showing. Option enable set to true.

Settings in my theme:
Vendor/MyTheme/etc/view.xml

<var name="magnifier">
    <var name="fullscreenzoom">10</var>  <!-- Zoom for fullscreen (integer)-->
    <var name="top"></var> <!-- Top position of magnifier -->
    <var name="left"></var> <!-- Left position of magnifier -->
    <var name="width">300</var> <!-- Width of magnifier block -->
    <var name="height">300</var> <!-- Height of magnifier block -->
    <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
    <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
    <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
</var>


texts: How Magento fulfils Product Exchange (RMA Exchange) request?

texts:
I want to understand the RMA Exchange process in depth, and how it will managed by Magento?
Lets say,

  Customer Requested for exchange product from Product-1 to Product-2?

I don't see there is option for add/edit product in already placed orders.

How Magento fulfills or Handle this type of request?


texts: Cancel Order in Magento 2 using REST api fails

texts:
I am working on a third party call to cancel an order on Magento 2.2.1 using the REST API.  From swagger it seems that all I need to do is POST to /V1/orders/{id}/cancel; no payload necessary.  However this is failing in my app and when I try to test it in Swagger I get the below error.Is there something missing or a possible bug?

{
  "messages": {
    "error": [
      {
        "code": 500,
        "message": "Fatal Error: 'Uncaught Error: Call to a member function allowStockUpdate() on string in /var/www/magento/app/code/WiseRobot/ChannelAdvisorAPI/Helper/Stock.php:458\nStack trace:\n#0 /var/www/magento/app/code/WiseRobot/ChannelAdvisorAPI/Helper/Stock.php(85): WiseRobot\\ChannelAdvisorAPI\\Helper\\Stock->_exportQty(155)\n#1 /var/www/magento/app/code/WiseRobot/ChannelAdvisorAPI/Observer/StockAfterSaveStockItemObserver.php(49): WiseRobot\\ChannelAdvisorAPI\\Helper\\Stock->exportQty(155)\n#2 /var/www/magento/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): WiseRobot\\ChannelAdvisorAPI\\Observer\\StockAfterSaveStockItemObserver->execute(Object(Magento\\Framework\\Event\\Observer))\n#3 /var/www/magento/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\\Framework\\Event\\Invoker\\InvokerDefault->_callObserverMethod(Object(WiseRobot\\ChannelAdvisorAPI\\Observer\\StockAfterSaveStockItemObserver), Object(Magento\\Framework\\Event\\Observer))\n#4 /var/www/magento/vendor/magento/module-staging/Model/Event/Manager.php(97): Magento\\' in '/var/www/magento/app/code/WiseRobot/ChannelAdvisorAPI/Helper/Stock.php' on line 458",
        "trace": "Trace is not available."
      }
    ]
  }
}


texts:
This is the data i am getting
2021-02-05T10:14:33+00:00 INFO (6): actionPOST http://local.hm.com/graphql HTTP/1.1
Host: local.hm.com
Connection: close
Accept-Encoding: gzip, deflate
User-Agent: node-fetch/1.0 (+https://github.com/bitinn/node-fetch)
Content-Length: 406
Content-Type: application/json
Accept: application/json

{"query":"\n mutation {\n createCustomer(\n input: {\n firstname: \"Dorothy\"\n lastname: \"Langley\"\n email: \"huhefoqis@mailinator.com\"\n password: \"Pa$$w0rd!\"\n is_subscribed: false\n }\n ) {\n customer {\n firstname\n lastname\n email\n is_subscribed\n }\n }\n }\n "}
2021-02-05T10:14:41+00:00 INFO (6): actionPOST http://local.hm.com/graphql HTTP/1.1
Host: local.hm.com
Connection: close

Data i want
{"query":"\n mutation {\n createCustomer(\n input: {\n firstname: \"Dorothy\"\n lastname: \"Langley\"\n email: \"huhefoqis@mailinator.com\"\n password: \"Pa$$w0rd!\"\n is_subscribed: false\n }\n ) {\n customer {\n firstname\n lastname\n email\n is_subscribed\n }\n }\n }\n "}

I need to get the above string (i.e {"query":"\n))
Code-
  $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/getActionName.log');
            $logger = new \Zend\Log\Logger();
            $logger->addWriter($writer);
            $logger->info('action'.$this->request);

Any thoughts ?


texts: How to remove empty attributes "N/A" in Magento 2?

texts:
I am using Magento 2 with Porto theme, I recently updated theme and magento now in product information I am also seeing empty attributes that are unrelated to the current products as N/A . how can I hide them?

I saw people discussing here this in Magento 1. but it doesn't work for 2.0.

please help if you know how to do it. thanks


texts: Following Allan Storm's tutorial and I encountered a problem in Part 5

texts:
Well, I am just learning to create modules, I am currently doing the part 5 of AllanStorm's tutorials this is the link:

http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics

I am currently in the part of adding the  inside the config.xml, the code says the following:

<global>
<!-- ... -->
<models>
    <!-- ... -->
    <weblog_resource>
        <class>Magentotutorial_Weblog_Model_Resource</class>
    </weblog_resource>
</models>
</global>

yet following the tutorial, I don't know what  is, and where should I place everything inside the config.xml, currently I am trying to add it like the following, but it doesn't work:

<config>
<modules>
    <TBGTEST_Helloworld>
        <version>0.1.0</version>
    </TBGTEST_Helloworld>
</modules>
    <frontend>
        <routers>
            <helloworld>
                <use>standard</use>
                <args>
                    <module>TBGTEST_Helloworld</module>
                    <frontName>helloworld</frontName>
                </args>
            </helloworld>
        </routers>
        <models>
            <helloworld>
                <class>TBGTEST_Helloworld_Model</class>
                <!--
                need to create our own resource, can't just
                use core_resource
                -->
                <resourceModel>helloworld_resource</resourceModel>
            </helloworld>
        </models>
    </frontend>

at the same time I don't know what the  tag means, i am sorry if this is so basic, I tried to discuss it in the tutorial but the discussion box at the bottom is deactivated. Thanks for the help..


texts: Class not defined in validation.js after upgrade to 1.9.4.0?

texts:
I updated from 1.9.3.7 to 1.9.4.0 using the .mage command line tool. Everything works fine in the admin, the frontend however always shows me Class is not defined. The code where this happens is in validation.js and looks like this:

var Validator = Class.create();

I checked that prototype.js is loaded before validation.js an it is, so that is not the problem I guess. Any other ideas why that happens? I cleared all the caches and I do not merge JS.


texts: How to exclude customer import in data migration tool

texts:
Can anyone help me on how to setup the data migration tool do not transfer the customer?

Thanks.


texts: how to integrate The Coupon Script in magento

texts: I am using magento 1.9.2.4 and i want to integrate The Coupon Script in my site. I want to know about steps to integrate this scrip in my site . Please help me as soon as possible.


texts: Setup automatic product redirect once out of stock on M1

texts: Is there an extension/module for M1 Enterprise that will manage redirects to a suitable category page once a product is out of stock and won't come back into stock?


texts: How do you manually create an EAV attribute on Magento 2.2?

texts:
I have been fighting with a module with an InstallData.php that will not execute on Magento 2.2.1, but I need to get this task done today.

For the meantime, how can I create the needed category thumbnail EAV attribute, so that the file will upload and save properly when the category is saved?

Is it as simple as creating the row in the "eav_attribute" table? I assume there must be more to the process?


texts:
I am trying to add an active class to the opc progress block.
I tried modifying the gotoSection function both in opcheckout.js and opcheckout_rwd.js but can't figure out how to change it to update the progress block.
I am not looking for a jQuery solution, I am sure there has to be an easy way to modify this function, so my class is added and removed properly when moving forward or backward in the checkout.

This is what I have done so far:

Added this to the Checkout.prototype.gotoSection function in opcheckout_rwd.js:

  var progressBlock = $(section + '-progress-opcheckout');
  progressBlock.addClassName('current');

Now I need to somehow modify the resetPreviousSteps function to remove the current class when moving back in the checkout...


texts: What determines which configurable option shows first, second, etc?

texts: I have configurable shirts with colors and sizes. Sizes show first in the detail view, but I want Colors to show first... how do I change this?


texts: Plugin for Magento\Shipping\Model\Rate\Result not working

texts:
I am trying to disable the default sorting based on price, that is happening on shipping methods.
I found that this is happening in sortRatesByPrice()

vendor/magento/module-shipping/Model/Rate/Result.php

public function sortRatesByPrice()
{
    if (!is_array($this->_rates) || !count($this->_rates)) {
        return $this;
    }
    /* @var $rate \Magento\Quote\Model\Quote\Address\RateResult\Method */
    foreach ($this->_rates as $i => $rate) {
        $tmp[$i] = $rate->getPrice();
    }

    natsort($tmp);

    foreach ($tmp as $i => $price) {
        $result[] = $this->_rates[$i];
    }

    $this->reset();
    $this->_rates = $result;
    return $this;
}

I basically just want to disable the sorting that happens here. (I.e. comment natsort($tmp))
I have tried to create a plugin for this, but this is not working.
This is my di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <type name="Magento\Shipping\Model\Rate\Result">
        <plugin name="dm_shipping_sortshipping" type="DM\Shipping\Plugin\Rate\Result" sortOrder="1" disabled="false" />
    </type>

</config>

This is my plugin
<?php

    namespace DM\Shipping\Plugin\Rate;

    class Result {

        public function beforeSortRatesByPrice()
        {
            $writer = new \Laminas\Log\Writer\Stream(BP . '/var/log/dm_debug.log');
            $logger = new \Laminas\Log\Logger();
            $logger->addWriter($writer);
            $logger->info('beforeSortRatesByPrice');
        }

        public function aroundSortRatesByPrice()
        {
            $writer = new \Laminas\Log\Writer\Stream(BP . '/var/log/dm_debug.log');
            $logger = new \Laminas\Log\Logger();
            $logger->addWriter($writer);
            $logger->info('aroundSortRatesByPrice');
        }

        public function afterSortRatesByPrice()
        {
            $writer = new \Laminas\Log\Writer\Stream(BP . '/var/log/dm_debug.log');
            $logger = new \Laminas\Log\Logger();
            $logger->addWriter($writer);
            $logger->info('beforeSortRatesByPrice');
        }

    }

Why are none of these firing? Log is empty.


texts: Magento 2 - Wrong version number in footer

texts:
Today I updated Magento 2.0.2 to 2.0.3 with Web Setup Wizard successfully.

But in admin footer is still the old version number of 2.0.2. How can it be?

I cleared the cache and the pub/static folder. No difference.


texts:
I'm trying to override modal-slide.html in my base theme so I place that file at:

app/design/frontend/<vendor>/base/Magento_Ui/web/templates/modal/modal-slide.html

But Magento just won't pick it up. I also tried to place it in these folders:

app/design/frontend/<vendor>/base/Magento_Ui/web/template/modal/modal-slide.html

app/design/frontend/<vendor>/<template>/web/template/modal/modal-slide.html

app/design/frontend/<vendor>/<template>/web/templates/modal/modal-slide.html

Of course I redeploy static-content and flush caches (browser too). Other overrides work. Just that doesn't.
I never overwrote files from the base directory though.

How can I override that template?


texts: Fetch all the students on the basis of ascending marks

texts:
This query fetches all the student name and there ids on basis of topics but i want to get these result on basis of ascending marks ... i.e select student_name and ids where  student_topic = topic but fetch them in the ascending order of there topic_marks
how and where should i add ->orderby() or ->order()

  $myTable = $this->_connection->getTableName('Students');
        $sql = $this->_connection->select()->from(
            ["tn" => $myTable], array('student_name', 'student_id')
        )->where('student_topic = ?', $topic);
        $result = $this->_connection->fetchAll($sql);
        return $result;


texts: Change default products per page in search results

texts:
When a user performs a search the default Magento search result pages offers pagination, it defaults to 9 items per page. I'd like it to default to 30 items per page.
How is this done?


texts: Make headlines sections in category page

texts:
Hello I am wondering if you can divide a category page with headlines?

Here I have a picture of my what I am troubling with, this is inside the category:


texts: Configurable swatches is not functionally working in Magento 1.9. Still asking "Please select items"

texts:
In my theme (bought from themeforest) Configurable swatches is integrated technically but not working functionaly. I can see the swatches in my Product page but when I click on them upon add to cart its showing error "Please select item". When I disable the Configurable swatches then traditional drop-down field is come up and its working.

So I wanted to know why configurable watches is not working? Googled a lot but no answer. Please guys help me in that.

This is the link : https://www.myshopingkart.com/clothing/men/haute-denim-navy-blue-main.html

This the error when I click on the swathces..


texts: how to get customer cart_item list in webservice magento1.9.3?

texts:
please check my code cart list not coming on "postman".

<?php
ini_set("default_socket_timeout", 200);
ini_set("max_execution_time", 200);
ini_set('display_errors','On');
error_reporting(E_ALL);

if($_REQUEST['hashkey'] =='NXqXAgFZA0jiWp5t6+=lGpgWJXEkbo' AND $_REQUEST['custid'] != '' )
{

$customer = $_REQUEST['custid'];

require_once ($_SERVER['DOCUMENT_ROOT'] .'/app/Mage.php');
Mage::app();
Mage::app()->getTranslator()->init('frontend');
Mage::getSingleton('core/session', array('name' => 'frontend'));

if($customer)
{
  $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();

foreach ($items as $item)
{
   $id= $item->getId();
   $p_id = $item->getProductId();
   if (is_null($id)) {
     $ret[$id]['id'] = "";
   }else{
     $ret[$id]['id'] = $item->getProductId();
   }

   if (is_null($item->getName())) {
     $ret[$id]['name'] = "";
   }else{
     $ret[$id]['name'] = $item->getName();
   }

   if (is_null($item->getPrice())) {
     $ret[$id]['price'] = "";
   }else{
     $ret[$id]['price'] = round($item->getPrice(),4);
   }

    $ret[$id]['cart'] = "1";

   $ret[$id]['sku'] = Mage::getModel('catalog/product')->load($p_id)->getSku();;

if (is_null($item->getQty())) {
    $ret[$id]['qty'] = "";
}else{
    $ret[$id]['qty'] = $item->getQty();
}

  $product = Mage::getModel('catalog/product')->load($p_id);
  $productimage = Mage::helper('catalog/image')->init($product, 'thumbnail');
  $ret[$id] ['image'] = (string)$productimage;
}

}
    $ret = array_values($ret);
$retfinal=array("success"=>"1" ,"message"=>"cart Items List","addtocart"=>$ret );
$result=json_encode($retfinal);
echo $result;

} else{
   $ret['success'] = "0";
   $ret['message'] = "This is error message...";
   $result=json_encode($ret);
   echo $result;
}

?>


texts: Magento 2: I need to show notification text below accordion in system fields

texts:
I need to show the notification text below the accordion. If the accordion tab is closed then it should also show.
This means after a group will show the text.

Anyone have an idea about this.
Thanks


texts:
First of all, thanks for MAGMI, Dweeves

I've been able to get Magmi working to import the product data without an issue.

The image, small_image and the thumbnail are visible on admin and front-end.

I am trying now for days to import the rest of the additional images, but so far I have no luck.

The image name is the same as the SKU,
for example 9781907339363.jpg, SKU is 9781907339363.

The additional images are 9781907339363_01.jpg, 9781907339363_02.jpg, 9781907339363_03.jpg ...etc...

or

SKU, image,"additional image"
1000629871, 1000629871.jpg,  "1000629871.1.jpg, 1000629871.2.jpg, 1000629871_3.jpg"  ...etc...

I hope that it is not a option to put all off these additional images by name in the csv file, i have about 50.000 SKU and about 120.000 images.
So not all the SKU has addional images.

I hope somebody can give me a direction how to import the addional images.

Magmi : 0.7.18

Image attributes processor : 1.0.25


texts: Mass Delete and other mass actions on Inventory grid throwing errors

texts:
We added some extra functionality to an Product inventory grid and now the default actions that were previously there all fail with this error below. Note products are selected with a check in the checkbox. So not sure why it says that "something needs to be selected" Any ideas what we forgot to do?

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): An item needs to be selected. Select and try again.

Exception #0 (Magento\Framework\Exception\LocalizedException): An item needs to be selected. Select and try again.
<pre>#1 Magento\Catalog\Controller\Adminhtml\Product\MassStatus->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#2 Magento\Catalog\Controller\Adminhtml\Product\MassStatus\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#3 Magento\Catalog\Controller\Adminhtml\Product\MassStatus\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#4 Magento\Catalog\Controller\Adminhtml\Product\MassStatus\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Controller/Adminhtml/Product/MassStatus/Interceptor.php:26]
#5 Magento\Catalog\Controller\Adminhtml\Product\MassStatus\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:108]
#6 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:231]
#7 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#8 Magento\Catalog\Controller\Adminhtml\Product\MassStatus\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]


texts: Magento 2.1 How to get and Display MSRP price programmatically?

texts:
I have used the below code:

<?php $objectManager = \Magento\Framewor\App\ObjectManager::getInstance();
   $product = $objectManager->create('\Magento\Catalog\Model\Product');?>
<?php echo $msrp = $product->getMsrp();?>.

But this code is not working.But MSRP Price is not displaying.Can you please help me?


texts: M2 - How to add admin user with different role from console?

texts:
As per magento doc, I am supposed to create an admin user as following:

<path_to_magento>/bin/magento admin:user:create --admin-user="admin" --admin-password="123123q" --admin-email="admin@example.com" --admin-firstname="Admin" --admin-lastname="Admin"

That's fine. Now suppose, I have a different role called reseller which has limited access to the admin. How do I assign that role if I create an user through console, or is this not possible?

In case this is not possible, can this be done through SQL queries? I have an external app which creates new sub stores and creates an admin user (who can only view the content of that store) for that store. I have managed to restrict the users to their stores but not sure how I can create that user while creating the instance of the sub-store.


texts:
I want to assign product to category by store.

What I did :

I update my database to add a column 'store_id' to catalog_category_product
When I save a product to category via the BO, I insert the store_id too

What I want to do now:

When I go to the product to see its categories. I want to make a distinction between category just for the store and global category.

Example of categories for product :

So, someone knows where is the code to get the collection which display the checked boxes ? I didn't succeed to find it.


texts: Get additional data via $object->getData() without having to reload the object

texts:
I need to get the value of the someValue attribute for a catalog/category object that has already been loaded. Unfortunately the pre-loaded object does not include the someValue attribute. Here's how I am currently getting the value for the someValue attribute:

$someValue = $category->getData('someValue'); // returns NULL

// Since the above getData() call returns NULL, I have to reload the whole category
$category2 = Mage::getModel('catalog/category')->load($category->getId());
$someValue = $category2->getData('someValue'); // returns the desired value

Is there a more convenient way to grab the someValue attribute value without having to create a separate category object ($category2)? I feel this additional object adds quite a bit of overhead and might affect scalability.

Thanks for any help!


texts: I found out that the font is on styles.css using the inspect mode(ctrl+shift+i), but when I change it and upload it via FileZilla and refresh the page it stills the same font as before, I'm completely new to this so be very specific please.


texts: What is the Default Product Image dimension on Magento?

texts:
I have tried to upload the product image with the dimension 2000 x 2000 but in the admin panel it showing the image dimension is 1200 x 1200 though I uploaded the image with 2000 x 2000. So my doubt is, what is the Default Product Image dimension on Magento?

Version: Magento 2.2.3

Please comment. Thanks.


texts: How to convert sql statement into magentoquery in magento 2

texts:
Hi Below are the 3 queries i need to convert it into magento queries..

1.

$details = $connection->fetchAll("SELECT sales_order.customer_id , sales_invoice.increment_id , sales_invoice.grand_total , sales_invoice.created_at , sales_order_payment.method  FROM sales_order inner join sales_invoice on sales_invoice.order_id = sales_order.entity_id inner join sales_order_payment on sales_order_payment.parent_id = sales_order.entity_id WHERE sales_order.increment_id = '" .$increment_id. "'");

2.

$update_xml_generated = ("INSERT INTO hydrogen_xml_generation (increment_id,xml_generated) VALUES('" .$increment_id. "' , '1')");

3.

$connection->query($update_xml_generated);

Can any body help on this .I don't know how to do it in magento because am a fresher.Thanks in advance.


texts: Error when install and uninstall module using composer Fatal error: Cannot declare class & Fatal error: require():

texts:
I am experiencing this issue after I installing / uninstall the extension from composer. I have been working with the extension provider but they can not figure about the issue. anyone has any insight?
When the module is installed using composer:
When the module is installed using composer:
After I installed via composer require mirasvit/module-rewards:* --update-with-dependencies
I get the following error when I ran php bin/magento setup:di:compile
Compilation was started.
Application code generator... 3/7 [============>---------------]  42% 15 secs 138.0 MiB
Fatal error: Cannot declare class Mirasvit\RewardsBehavior\Observer\ThirdParty\MirasvitAdvn\EarnOnMirasvitAdvnCustomerSubscribed, because the name is already in use in /home/customer/www/demo1.mywebsite.com/public_html/vendor/mirasvit/module-rewards/src/RewardsBehavior/Observer/EarnOnMirasvitAdvnCustomerSubscribed.php on line 23

this is the starting of line 23 /vendor/mirasvit/module-rewards/src/RewardsBehavior/Observer/EarnOnMirasvitAdvnCustomerSubscribed.php
class EarnOnMirasvitAdvnCustomerSubscribed implements ObserverInterface
{
    /**
     * @var \Mirasvit\Rewards\Helper\BehaviorRule
     */
    protected $rewardsBehavior;

When the moduel is uninstalled using composer:
After I ran php -f bin/magento module:disable Mirasvit_Rewards Mirasvit_RewardsAdminUi Mirasvit_RewardsApi Mirasvit_RewardsBehavior Mirasvit_RewardsCatalog Mirasvit_RewardsCheckout Mirasvit_RewardsCustomerAccount, and composer remove mirasvit/module-rewards when i try to run any php bin/magento commands, i get the following error.
 Fatal error: require(): Failed opening required '/home/customer/www/demo1.mywebsite.com/public_html/vendor/composer/../mirasvit/module-core/src/Core/registration.php' (include_path='/home/customer/www/demo1.mywebsite.com/public_html/vendor/magento/zendframework1/library:.:/usr/local/php71/pear') in /home/customer/www/demo1.mywebsite.com/public_html/vendor/composer/autoload_real.php on line 70

seems like it is trying  to load something that doesn't exist anymore?


texts: Change configurable swatches order in Magento 2

texts:
I want to know how can I change/set configurable swatches sort order in a products list page in Magento 2 ?

For example in the case above I want to have from top to bottom:

Colors
Shapes
Sizes

But at the moment it is:
Sizes
Shapes
Colors

Any helps are appreciated.


texts: I want to know the complete flow of a magento view. Suppose i am viewing the home page, can I ask how the flow of control goes through the PHTML, XML and PHP files , in order to view the home page? Basically wanted to know the flow of control of magento.Here which are the file which is considered as Controller?


texts: programmatically generate coupon code does not display on admin

texts:
I have programmatically generated coupon code, But it does not display on Admin->Promotions->Shopping Cart Price Rules. Why ?

    $coupon = Mage::getModel('salesrule/rule');
    $coupon->setName('testing_name')
   ->setDescription('testing_name')
   ->setFromDate(date('2017-01-01'))
   ->setCouponType(2)
   ->setCouponCode('ASASASASAS')
   ->setUsesPerCoupon(1000)
   ->setUsesPerCustomer(100)
   ->setCustomerGroupIds(array(1)) //an array of customer groupids
   ->setIsActive(1)
   //serialized conditions.  the following examples are empty
   ->setConditionsSerialized('')
   ->setActionsSerialized('')
   ->setStopRulesProcessing(0)
   ->setIsAdvanced(1)
   ->setProductIds('')
   ->setSortOrder(0)
   ->setSimpleAction('by_percent')
   ->setDiscountAmount(100)
   ->setDiscountQty(null)
   ->setDiscountStep('0')
   ->setSimpleFreeShipping('0')
   ->setApplyToShipping('0')
   ->setIsRss(0)
   ->setWebsiteIds(array(1));
    $coupon->save();

At last print_r($coupon);  Will give coupon detail But it not displays admin side.


texts: Static files not getting generated magento 2.3

texts:
I ran command php bin/magento setup:static-content:deploy -f and i am getting this error https://prnt.sc/ot0gpp
Please help what to do, my static files are not getting generated because of which my site is down. its very urgent, please help


texts:
I am trying to update quote item in magento2. But every time i am saving the item its creating a new item with the same quote id rather than updating it. Here is my code

    public function __construct(
            \Magento\Quote\Model\QuoteRepository $quoteRepo
        ){
            $this->_quoteRepo = $quoteRepo;
        }

public function updateItem(){
    $quote = $this->_quoteRepo->get('id here');
    foreach($quote->getAllVisibleItems() as $itemq){
    $itemq->setQty(5);
    $itemq->setPrice(20);
    $itemq->save();
    }
 }

But every time its saving an item.. a new item is getting generated. Dont know why. Also I couldn't find any class which explicitly load qoute item in magento2. Help will be appreciated.

In this question https://magento.stackexchange.com/questions/139298/how-to-save-quote-items-in-magento-2 they are setting the whole product... not trying to update it. When you set a product a new quote item will surely generate. But why its doing the same in case of updation.


texts: Magento upgrade 2.2.7 to 2.4.1 SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

texts:
after running upgrade command i get the following error
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (building_staging.#sql-dae_19322, CONSTRAINT CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCADE), query was: ALTER TABLE catalog_product_entity_decimal MODIFY COLUMN value decimal(20, 6)  NULL  COMMENT "Value", ADD CONSTRAINT CAT_PRD_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID FOREIGN KEY (attribute_id) REFERENCES eav_attribute (attribute_id)  ON DELETE CASCADE, ADD CONSTRAINT CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id)  ON DELETE CASCADE, ADD CONSTRAINT CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id)  ON DELETE CASCADE
any help would be amazing
thanks


texts: Problem after migrating magento 2 to a new server

texts:
I started developing a magento 2 website a dedicated server with an IP lets say (85.85.85.85) with Centos 7 and when I finished my development I downloaded the whole html folder (magento root) with a mysql backup and I reformatted my dedicated server and i putted Centos 7 with Plesk. I followed an article about migrating my website and i uploaded the files restored the database, connect the database with the files, changed the core_config urls and when I hit my domain on browser its says me "File not found.". Some of my plesk error logs can be shown here(1.http://prntscr.com/jdtyyw 2.http://prntscr.com/jdtz8g 3.http://prntscr.com/jdtzkc 4.http://prntscr.com/jdtzox)
If anyone knows what happens here please help me unstuck from this,
Every help would be appreciated.
Thank you!

-----EDIT-----
I corrected the file permissions
When I run the command line

php bin/magento setup:upgrade

its says me this message

[Exception]
Warning: file_get_contents (/var/www/vhosts/domainname/httpdocs/var/di/setup.ser) :
failed to open stream:
No such file or directory in /var/www/vhosts/domainname/httpdocs/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php on line 28


texts: How can I change the favicon of a Magento 2 store by code in my custom theme? without using admin backend interface.


texts:
I am new to Magento. I need to include an external code into my store.

<script src='https://cdn.rawgit.com/michalsnik/aos/2.0.4/dist/aos.js' src_type="url" /></script>

I have included this above into app\design\frontend\MMtheme\framework\Magento_Theme\layout\default_head_blocks.xml but js file makes conflicts.

default_head_blocks.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
    <css src="//fonts.googleapis.com/css?family=Open+Sans:400,600,300" src_type="url" />
    <css src="css/font-awesome.css" />
    <css src="css/grid.css" />
    <css src="css/modules.css" />
    <css src="css/style.css" />
    <css src="css/mega_menu.min.css"/>
    <css src="css/demo.css"/>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-1.11.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/mega_menu.min.js"></script>
<script src="js/aos.js"></script>

</head>


texts:
I have create a new item in admin menu, next to System.
My item has two children but when I click in them, appears a blank page. How can I add info or content into this pages?

I added it in my adminhtml.xml and I have a CustomController.php with the next function:

public function listAction(){
  $this->loadLayout()
       ->setActiveMenu('mycustomtab')
       ->_tittle($this->__('View'));
  $this->renderLayout();
}

I don't know where I should put the code.


texts: Magento 2 admin panel inaccessible after modyfying admin base URL

texts:
After installing Magento 2 on my web hosting account, I changed the admin base URL, and from then, I couldn't access the admin panel any longer. Web browsers state improper redirection that goes into endless loops.

Sometimes I can login to the admin, but cannot proceed further. Then I get stopped here: https://www.example.com/admin/admin/admin/dashboard/index/key/346c5e0399f97b43019e7fda6caa5e4a63e3920b17cda68fba711755c484cfd0/

I ran into the issue while customizing the Magento 2 admin URL and no longer has access to the admin panel. Trying to open the admin page results to "improper redirection" that goes into endless loops. And the URL becomes http://www.example.com/admin/admin/admin/index/index/key/blablabla. I can only get to the admin login page displayed in raw HTML with no formatting. But I can't gain access after typing in the correct login details.

The mistake I made was this:

"Use Custom Admin URL: Yes"

"Use Custom Admin Path: No"

"Custom Admin Path: admin"

I can surely edit PHP files on the server and database tables in phpMyAdmin, if given clear step-by-step instructions.

Below is a screenshot of my "mgct_core_config_data" table regarding admin URL:

Any help would be much appreciated. Thanks in advance.


texts: How to deal with complicated Size System

texts:
i am buiding up a sneaker Store.
Sneakers are an international Product an every Shoe comes, obviously, in different sizes. In different Parts of the world, different Sizings are used (Europe 37-46, US 5-13, UK 5-13, Asia CM 22-35).

I want to have an configurable Product where the Customer can choose the size in different systems but in BackEnd i want to have

SimpleShoe in Size EU40/US8/UK7
SimpleShoe in Size EU41/US8.5/UK7.5
…

Each Shoe as one Product to handle the inventory.

Did anyone realized something like this?


texts: Why changes in a CMS block doesn't appear?

texts:
I have a quite simple problem which I can't address.
I've been changing Static Blocks from CMS -> Static Blocks (e.g. a Prices page).

Once I change the Block and save it, my website doesn't seem to update the page with the new changes.

Thanks a lot!

Carla


texts:
On the view.phtml is it possible to write php to change the layout depending on what item is displayed on that page?

Using code similar to this:

$this->loadLayout()
                   ->getLayout()
                   ->getBlock('root')
                   ->setTemplate('page/1column.phtml');
$this->renderLayout();


texts: Magento 2 : Payment method transaction declined error in frontend but in adminpanel its works

texts:
Magento 2 with eway payment module. I have create sandbox account in eway payment site and set configuration for it.

When place order using admin panel transaction done successfully but from front end side, when place order using eway , there is an error thrown by browser and stuck payment.

  Transaction has been declined, please, try again later

Also i have check for payment data passed, all payment data passed are display successfully in request.

Request call are, payment method data passed as null value.

'request' => array (
    'Number' => NULL,
    'Name' => 'rakesh jesadiya',
    'Number' => NULL,
    'ExpiryMonth' => NULL,
    'ExpiryYear' => NULL,
    'StartMonth' => NULL,
    'StartYear' => NULL,
    'IssueNumber' => NULL,
    'CVN' => NULL
  )
  'request_uri' => 'https://api.sandbox.ewaypayments.com/Transaction',

But when place order its show error in only frontend.

How to pass data with value in payment info in above request same value are fill up in admin place order.

Any Help would be appericiated.


texts: I have created a table abc_bar/baz Here, I want that it's filed name should be unique, is there an easy way in magento to check this.


texts:
When trying to sync installed modules I get the following error: Error:
sync: Channel 'enterprise' doesn't exist

When I try to remove the channel I get: Error:
channel-delete: 'enterprise' was not found in aliases, channel names, channel uris


texts: How to add a static block on all pages on Magento 2

texts:
I want to add a static block on the left side of all pages.

Can anyone tell me how to do that?


texts:
i already have a table in database also created model files and all works fine so now added another table successfully so what changes i need to do with model files

i mean in model resourcemodel and connection files..


texts: After reinstall magento2 in localhost the dashboard working not properly

texts:
when I am reinstall the magento2 in my localhost the admin not working properly.
sales,products,customers... are not opening properly in my admin panel.


texts: Magento 2: Remove Escape Character on Magento Search Query

texts:
I am using Elasticsearch 5.6 in our Magento Enterprise 2.2.9.

I have already set the SKU to be "not analyzed", so that  searching for SKU with dash(-) will give me exact result. Ex 414-123

However, Magento is escaping the dash in the search query.

Magento generated query, no result:

{
"match": {
    "sku": {
        "query": "414\\-123",
        "operator": "OR",
        "prefix_length": 0,
        "max_expansions": 50,
        "fuzzy_transpositions": true,
        "lenient": false,
        "zero_terms_query": "NONE",
        "boost": 2
    }
}

}

No escape character query, 1 result (expected):

{
"match": {
    "sku": {
        "query": "414-123",
        "operator": "OR",
        "prefix_length": 0,
        "max_expansions": 50,
        "fuzzy_transpositions": true,
        "lenient": false,
        "zero_terms_query": "NONE",
        "boost": 2
    }
}

}

Is it possible to remove the escaping in Magento Catalog Search module?


texts: Unable to show custom customer attribute only in adminhtml customer form

texts:
I have created some custom customer attribute that I need to show only in admin customer form.
For these attributes i used in my InstallData 'used_in_forms' => ['adminhtml_customer']

In customer_form_attribute my attribute code matches the used_in_form code but I'm able to show it in admin only if I add 'used_in_forms' => ['customer_account_edit'], but this way it is shown also in the frontend.

Is there a way to show it only on the admin side?

EDIT:

Here is upgrade code

public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();
    if (version_compare($context->getVersion(), '1.0.2', '<')) {
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

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

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

        $customerSetup->addAttribute(Customer::ENTITY, 'my_attribute', [
            'type' => 'int',
            'label' => 'My attribute label',
            'input' => 'boolean',
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 1000,
            'position' => 1000,
            'system' => 0,
            'default' => 1,
        ]);
        //add attribute to attribute set
        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'my_attribute')
            ->addData([
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer'],
            ]);

        $attribute->save();
    }

    $setup->endSetup();
}


texts: Fatal error during compilation disable the site

texts:
I tried to enable compilation and when I run the compilation process, I got this error. How can I solve this error?

  Fatal error: Class 'Alin_ProductGift_Model_Resource_Eav_Mysql4_Setup' not found in includes/src/Mage_Core_Model_Resource_Setup.php on line 234


texts: Get Order and Customer Data of Guest user after `sales_order_place_after` triggered Magento 1.9

texts:
I need only
customer_id, product_id, customer_email

I am using

  <sales_order_place_after>
    <observers>
      <checkout_submit_all_after_handler>
        <type>model</type>
        <class>amxnotif/observer</class>
        <method>getAlertFrontend</method>
      </checkout_submit_all_after_handler>
    </observers>
  </sales_order_place_after>

In Observer.php

public function getAlertFrontend(Varien_Event_Observer $observer)
{
           Mage::log('we are in cataloginventory frontend log start ');
        $event = $observer->getEvent();
        $order = $event->getOrder();

        $orderId = $order->getIncrementId();  // working

        $customer = $order->getCustomer();
        $productId = $order->getProductId();
        $customer_id = $order->getCustomerId();
        $orderItem = $order->getItem();

        Mage::log("order_data start");
        Mage::log( $order->getEmail() );
        Mage::log( $orderItem );
        Mage::log( $customer_id );
        Mage::log("order_data ends");
        $customerData = Mage::getModel('customer/customer')->load($customer_id);
        $customerName = $customerData->getName();

         Mage::log("customer_data start");
        Mage::log( $customerName );
        Mage::log( $customerData );

        Mage::log("customer_data ends");

        Mage::log(sprintf('Order Id :: %s ,Product Id :: %s Customer Id :: %s ',$orderId, $productId, $customer_id));

           Mage::log('we are in cataloginventory frontend log ends ');

}

But i am only getting DEBUG (7): Order Id:: 100000144, Product Id::  Customer Id::


texts: How to display saved Custom field value with reviews for product details page in magento1.9

texts:
I have created Custom fields in admin section for "catalog_product_review" comment reviews reply. i have created reply field for every comment, from admin side admin can reply to products comment. i have saved reply field value in database table "review_detail".
Now I want display Reply for every comment to customers on front end.
How to do. Is there any custom code please give me suggestion or share custom code.
because I'm unable to find the custom code for display reply for every comment like on reviews section on products detail page.


texts:
I created some columns in sales order grid like product SKUS, It is visible in grid column as well,

But while I am export using export button, CSV return blank columns for SKUS.

Any one have idea then please share.


texts:
This is my script

<script>
function callAjax(){
    var customoptionhtml = document.getElementById("customoption-dynamic").innerHTML; //alert(test);//alert(jQuery(test).text());
    var subtotalhtml = jQuery('.price-wrap').html();//alert(innerHtml);
     jQuery.ajax({
        type    : "POST",
        url     : "<?php echo Mage::getUrl('module/controller/action'); ?>",
        data    : jQuery('#product_addtocart_form').serialize(),
        data    : { customoption: customoptionhtml,formser:jQuery('#product_addtocart_form').serialize(),subtotal:subtotalhtml } ,
        dataType: "json",
        complete: function(response) {
            //action
        },
    });
}
</script>

This is my controller

public function testAction() {
        $product = $this->getRequest()->getParam('formser');
        $customoption = $this->getRequest()->getParam('customoption');

        $pdctname = $product['product'];
        Mage::log($product, null, '1.log');
        Mage::log($customoption, null, '2.log');

}

I got $product in log file as :

  form_key=ZWdfUerRFgl9oR4r&product=1&related_product=&options%5B9%5D=tryty&options%5B10%5D=85&options%5B11%5D=132&options%5B12%5D=156&options%5B13%5D=181&options%5B16%5D=&options%5B17%5D=&options%5B19%5D=&options%5B18%5D=&options%5B14%5D=183&options%5B15%5D=&name=ry&companyname=ty&email=test%40test.com&phnmbr=7894561233

I want to get "product=1"(marked in bold) from the above data(that is the product id).

I tried as $pdctdet = $product['product']; .But not working.

Please give a solution.


texts: I want to fetch Product Names on behalf of comma separated SKU's i.e. sku1,sku2,sku3 and the expected result is Name1,Name2,Name3


texts: Magento inventory: Quantity source reduces by 2 instead of 1

texts:
I am creating a shipment programatically. When an order is placed for the product, at order completion, quantity per source gets reduced by 2 instead of 1.

Here's my code

if($this->order->hasShipments()){
            return;
        }

        $shipment = $this->convertOrder->toShipment($this->order);

    foreach($this->order->getAllItems() as $orderItem){

        $qtyShipped = $orderItem->getQtyToShip() == 0 ? 1 : $orderItem->getQtyToShip() ;
        $shipmentItem = $this->convertOrder->itemToShipmentItem($orderItem)->setQty($qtyShipped);
        $shipment->addItem($shipmentItem);
    }

    $shipment->register();

    $shipment->getOrder()->setIsInProcess(true);

        $websiteId = $order->getStore()->getWebsiteId();
        $stockId = $this->stockByWebsiteIdResolver->execute((int)$websiteId)->getStockId();
        $sources = $this->getSourcesAssignedToStockOrderedByPriority->execute((int)$stockId);

        foreach ($sources as $source) {
            $sourceCode = $source->getSourceCode();
        }

       $shipmentExtension = $shipment->getExtensionAttributes();

    if (empty($shipmentExtension)) {
        $shipmentExtension = $this->shipmentExtensionFactory->create();
    }
    $shipmentExtension->setSourceCode($sourceCode);
    $shipment->setExtensionAttributes($shipmentExtension);

 $shipment->save();

Thanks!