texts:
I have both android and web application running. Now i'm trying to assign coupon that can be redeemable only in mobile application.

To achieve this I've done below steps

Step 1 : To differentiate the order, I've created a custom column named order_via in sales_flat_quote table.

Step 2 : Using event observer i'm modifying order_via. i.e, when a product is added to cart via mobile it's order_via value is Mobile App and Web when it is placed via web application.

Step 3 : Extended Mage_SalesRule_Model_Rule_Condition_Address to add custom Cart Attribute i.e, Order Via to existing rules (screenshot) using below code

class Namespace_Module_Model_Rule_Condition_Address extends Mage_SalesRule_Model_Rule_Condition_Address {

    public function loadAttributeOptions() {
        $attributes = array(
            'base_subtotal' => Mage::helper('salesrule')->__('Subtotal'),
            'total_qty' => Mage::helper('salesrule')->__('Total Items Quantity'),
            'weight' => Mage::helper('salesrule')->__('Total Weight'),
            'payment_method' => Mage::helper('salesrule')->__('Payment Method'),
            'shipping_method' => Mage::helper('salesrule')->__('Shipping Method'),
            'postcode' => Mage::helper('salesrule')->__('Shipping Postcode'),
            'region' => Mage::helper('salesrule')->__('Shipping Region'),
            'region_id' => Mage::helper('salesrule')->__('Shipping State/Province'),
            'country_id' => Mage::helper('salesrule')->__('Shipping Country'),
            'order_via' => Mage::helper('salesrule')->__('Order Via')
        );
        $this->setAttributeOption($attributes);

        return $this;
    }

}

I created a coupon with my new condition i.e Order Via Web. I've applied it in cart page but it's not working.

I think i need to add this custom column_id i.e, order_via to existing object. Don't know how. Any solution to make this work.


texts: Override Coupon Code in Cart Programmatically

texts:
Magento 1.7.0.2. I need to check for a coupon code that the customer enters and then if the subtotal is over a given amount I need to change that rule so that I can cap the discount using another rule.

So far I can grab the current coupon as $coupon by using a simple if statement:

if (strtolower($coupon) == 'mycoupon') {

But then it doesn't seem to matter what combination of code I use I can't get it to update the coupon to something else. Here's one method I tried:

$coupon = 'MYNEWCOUPON';
$getCoupon = Mage::getModel('salesrule/coupon')->load($coupon, 'code');
$rule = Mage::getModel('salesrule/rule')->load($getCoupon->getRuleId());

Any ideas what else I could do here?


texts: Today when I looked at my site all the products are gone from the home page.  When I check the catalog the products are still in the database and none of the values have changed.  If I search, I find the product or if I look at the category the product is there, just not on the home page.  Thoughts??


texts: How to get dropdown product attribute value Magento2

texts:
I have created a product drop-down attribute and assigned a value to it on the product.

I need them on product detail page.

$_attributeValue = $_product->getResource()->getAttribute('product_type')->setStoreId(0)->getFrontend()->getValue($_product);
echo $_attributeValue;

OR

$_attributeValue = $_product->getResource()->getAttribute('product_type')->getFrontend()->getValue($_product);
echo $_attributeValue;

Output as

  NO

On print($_attributeValue) my output

Magento\Framework\Phrase Object ( [text:Magento\Framework\Phrase:private] => No [arguments:Magento\Framework\Phrase:private] => Array ( ) )

But for product text attribute I get the output.


texts: Change Price on CMS page based on currency selected

texts:
Can someone tell me in a multi-currency store, lets say on CMS page I want to write "Today's Deal XYZ product in USD 100. Now I want this "USD 100" to change based on store currency selected. How can i achieve this on a CMS page? Is it also possible to do this on static block?

Thanks in advance for your help!


texts: customer's password not displayed in email templates magento 2.1.5

texts:
I have try to add password on customer account email template but not able to getting password. Any one knows how can i set password on customer email template ?

Really appreciate who knows solution.


texts: Sellable Quantity Not Matching Product Quantity

texts:
I have alot of SKU which the sellable quantity is less that the actual quantity.
So quantity could be 5, but sellable quantity is 3.
I thought it could be open orders, or processing orders, so I deleted all of them using the mageplaza extension however the issue is not resolved

There are no open orders with the items in them, so is there a way to re-fresh the sellable quantity or delete whatever is causing it not to match the actual quantity

Any help greatly appreciated


texts: How to add a frontend search box functionality for a custom table grid magento2

texts: I have created a custom module and get data in the list format, now I want to add search functionality on the list view, so how can I add that?


texts: Multiple store Payment Gateway issue and Paypal Currency Issue

texts:
I have Multiple stores with Domain and subdoamin. I am facing a Strange error. in my multistore domains all payment gateway is working fine. But if i am using same on my subdomains multiple store its redirecting on main website. rather then same subdomain checkout page.

Second qus is My base currency is INR but one my store i am using USD tried to checkout with Payment its giving currency Not Supported issue.

Please Guide me


texts:
I am loading an external script on a Magento CMS page. On the CMS page, I have the following div:

<div id="feefo-service-review-widgetId" class="feefo-review-widget-service">
  </div>

And in the footer I put the following script:

<script type="text/javascript"
 src="https://api.feefo.com/api/javascript/marsden"></script>

The page that should load the info is the following:

http://www.marsden-weighing.co.uk/feefo-2

The problem is that initially not all reviews are loaded. I noticed that if I click on a link and go back, then all reviews are loaded. Is it a problem with the loading of the script? Is there a workaround? I also tried to add 'asycn' but no success :( Any pointer much appreciated.


texts: SET THE RIGHT DOMAIN NAME IN MAGENTO 2 COOKIES

texts:
I set cookies (in Magento 2.3.1 EE) with this code below:
<script type="text/javascript">
require([
    'jquery',
    'jquery/jquery.cookie'
], function ($) {
    $(document).ready(function () {
        var check_cookie_store_source = $.cookie('StoreSource');
        var check_cookie_store_locator_store_id = $.cookie('store_locator_store_id');
        console.log('set Just In');
        if (!check_cookie_store_source){
            $.cookie('StoreSource', '5');
            console.log('set check_cookie_store_source');
        }
        if (!check_cookie_store_locator_store_id){
            $.cookie('store_locator_store_id', '10');
            console.log('set check_cookie_store_locator_store_id');
        }
    });
});

So Now, I need to have magento2.docker in domain name not .magento2.docker (check dot before).
I also use this sentaxe :
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'magento2.docker' });

I continue to get dot(.) before my domain name, please help me understand and solve this probleme

Thank you


texts:
Is there any Magento1.x Extension that allows me to export orders specification? I need to create a report with the following data:

order_id (one order can have more than one product)
customer_name
product_sku
product_name
quantity
date

Is there any extension that helps me do this?


texts: Sales Order Grid Custom Field value not saved

texts:
I have create a custom field(zipcode) in sales_order and sales_order_grid, after that i try to save to database while click  placeorder the order in frontend,so try to use checkout_submit_all_after event, But its not save my custom field value.

what i did:

vendor/module/etc/frontend/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="checkout_submit_all_after">
          <observer name="custom_checkout_submit_all_after"
                    instance="vendor\Module\Observer\SalesOrderPlaceAfter"
                    />
      </event>
  </config>

Then create a Observer to to save Custom Field Value.

vendor/module/Observer/SalesOrderPlaceAfter.php:

    use Magento\Framework\Event\ObserverInterface;

    class SalesOrderPlaceAfter implements ObserverInterface
    {

        public function execute(\Magento\Framework\Event\Observer $observer)
        {
            try {
                $order = $observer->getEvent()->getOrder();
                $order->setZipcode("604503");
                $order->save();
            } catch (\Exception $e) {
                error_log($e->getMessage());
            }
        }
    }

But its have save My custom Field value, Suggest me How to fix this.


texts: Catalog product list widget reload the page when i click on the paging button

texts:
When I use a Catalog Products List widget in the Home page the button in this products list reloads the current page to show other product (I display only 5 items by pages)
User experience suffers from this and it would be desirable if the button would not reload the page to show other products.


texts:
I have installed Magento 2.3.0 in my local machine, but it stuck at 50% there is no error on Magento console.log but I could see an error in browser console.

Error Snapshot: https://www.screencast.com/t/OidJb3M0

  http://localhost/zmagento/setup/index.php/session/prolong its
  returning {"success":false}

I'm using PHP Version 7.1.25 on my local machine.


texts: Remove current product from Recently Viewed Products on the product view page

texts:
Basically the same question was asked here: Magento 2 shows current product as recently viewed product but the answer there doesn't apply for Magento 2.2 versions (or which ever version introduced the recently viewed widget as a ui component).

So I'm wondering if anyone has an idea how to remove the current product (which the customer is viewing on the product view page) from the recently viewed widget which is placed on the product view page?

I've tracked the functionality to Magento_Catalog/ui_component/widget_recently_viewed.xml and to the template file Magento_Catalog/web/template/product/list/listing.html which calls the filteredRows function from Magento_Catalog/web/js/product/list/listing.js.

But I'm not sure how to exclude the current product from the data source, so any help would be appreciated.

EDIT This seems to be solved by default in Magento 2.3.3+ versions.


texts: Error, "URL key for specified store already exists" When I'm Adding Products or Moving a Category

texts:
I'm getting the error, "URL key for specified store already exists" when I try moving or adding products to a category in Magento 2 (Version 2.1). I have searched all over for a fix and even tried the fix here on Gihub but still I keep getting the error. The other problem even is that when I manually add or change a "URL Key" to make it work I still get the error.

Any help would be much appreciated.


texts: Showing certain product price on an cms page

texts:
So I am trying to show a certain products price on an cms page. Is there anyway that I can do this?

I have a hardcoded landing cms page and I wanted to display dynamically a price of a certain product.


texts: Magento2 Innermost category selection as Radio Button

texts:
like we have check-boxes for selecting category for products, but for a specific requirement I want to limit the selection of innermost category to just one instead of multiple.

for example parent->chilld->multiple child

so what I want is from Multiple child just one can be selected even if it is checkbox.


texts: How to override my accounts address form?

texts:
I tried,

Test/Myaccount/etc/module.xml

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

Test/Myaccount/view/frontend/templates/address/edit.phtml

<form class="form-address-edit" action="<?php /* @escapeNotVerified */ echo $block->getSaveUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data" data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>">
<fieldset class="fieldset">
    <legend class="legend"><?php /* @escapeNotVerified */ echo __('Contact Information') ?></legend>

    <?php echo $block->getBlockHtml('formkey')?>
    <input type="hidden" name="success_url" value="<?php /* @escapeNotVerified */ echo $block->getSuccessUrl() ?>">
    <input type="hidden" name="error_url" value="<?php /* @escapeNotVerified */ echo $block->getErrorUrl() ?>">
    <?php echo $block->getNameBlockHtml() ?>

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

            <input type="text" name="company" id="company" title="<?php /* @escapeNotVerified */ echo __('Company') ?>" value="<?php echo $block->escapeHtml($block->getAddress()->getCompany()) ?>" class="input-text <?php /* @escapeNotVerified */ echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>">

</form>

Test\Myaccount\view\frontend\layout\customer_account_edit.xml

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

    <referenceBlock name="content" template="Test_Myaccount::address/edit.phtml"></referenceBlock>

</page>

It does not work.


texts: Why separate Redis instances for sessions and cache?

texts:
Official Magento guidance is to use separate Redis instances for cache and session storage. What is the reasoning behind this?

I've seen some old references mentioning that it is for ease of cache clearing (which can be fixed by using separate Redis databases) or to prevent sessions from being dumped if the cache fills up (which can be avoided by provisioning sufficient capacity). Are there reasons beyond these?

Does this still apply if using Amazon ElastiCache as the Redis-compatible provider?


texts: How Does Magento set the HTTP Referrer Request Header?

texts:
According to conventional wisdom, forcing a browser to set the Referer HTTP Request header is more or less impossible. I know that I cannot do it from server-side, and I cannot find any solutions client-side (via JavaScript).

I use Firefox which pretty much guarantees that with every page request I send, the Referer header is absolutely not sent. However, when I navigate to my Magento site and then look at the request headers (listed by the LiveHeaders addon), right there it has the Referer header set.

How exactly does Magento accomplish this? I'm not looking for an explanation on which modules/models/library objects are responsible for this. I would like to know what base mechanism they are exploiting(?) to achieve it? It absolutely baffles me!

The only way I can see them accomplishing this is that for every HTTP request a Magento web server receives, it does an internal redirect to the same page but with some added headers (like Referer), and then returns THAT response.

Other than that, I have no clue how those guys do this?


texts: Order # 000000012 (The order confirmation email was sent) in localhost

texts: In Magento 2  email is not received  after order is placed.    How to fix that issue? am using in localhost and also i configure with SMTP still email will not received


texts: Magento in Xampp server ( localhost ) indexer:reindex

texts:
I'm running Magento latest version in my localhost with xampp, it's great. but in admin panel, I see an error

One or more indexers are invalid. Make sure your Magento cron job is
running.

I searching for a solving I get this one

indexer:reindex

but how I make it with xampp ?? or the localhost??


texts: i want to place my module inside catalog menu in admin panel?

texts:
How to add my module Matrid_Freemanager inside catalog menu with manage item submenu . my file  web.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Web>
            <version>0.1.0</version>
        </Company_Web>
    </modules>
    <frontend>
        <routers>
            <web>
                <use>standard</use>
                <args>
                    <module>Company_Web</module>
                    <frontName>web</frontName>
                </args>
            </web>
        </routers>
        <layout>
            <updates>
                <web>
                    <file>web.xml</file>
                </web>
            </updates>
        </layout>
    </frontend>
    <admin>
        <routers>
   <web>
    <use>admin</use>
    <args>
     <module>Company_Web</module>
     <frontName>web</frontName>
    </args>
   </web>
        </routers>
    </admin>
    <adminhtml>
<menu>

   <web module="web">
        <title>Matrid_Feedmanager</title>
            <sort_order>29</sort_order>
                <children>
                        <items module="web">
                            <title>Manage Items</title>
                                <sort_order>0</sort_order>
                            <action>web/adminhtml_web</action>
                        </items>
                </children>
    </web>

 </menu>
  <acl>
   <resources>
    <all>
     <title>Allow Everything</title>
    </all>
    <admin>
     <children>
      <Company_Web>
       <title>Web Module</title>
       <sort_order>10</sort_order>
      </Company_Web>
     </children>
    </admin>
   </resources>
  </acl>
  <layout>
   <updates>
    <web>
     <file>web.xml</file>
    </web>
   </updates>
  </layout>
    </adminhtml>
    <global>
        <models>
            <web>
                <class>Company_Web_Model</class>
                <resourceModel>web_mysql4</resourceModel>
            </web>
            <web_mysql4>
                <class>Company_Web_Model_Mysql4</class>
                <entities>
                    <web>

web

                    </web>
                </entities>
            </web_mysql4>
        </models>
        <resources>
            <web_setup>
                <setup>
                    <module>Company_Web</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </web_setup>
            <web_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </web_write>
            <web_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </web_read>
        </resources>
        <blocks>
            <web>
                <class>Company_Web_Block</class>
            </web>
        </blocks>
        <helpers>
            <web>
                <class>Company_Web_Helper</class>
            </web>
        </helpers>
    </global>
</config>


texts: During Data Migration Getting Access Violation Issue

texts:
During data migration from Magento1 to Magento2, I'm getting the following issue:-

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
  error in your SQL syntax;  check the manual that corresponds to your
  MySQL server version for the right syntax to use near ';   END;
  INSERT INTO m2_cl_cataloginventory_stock_item (item_id, operation)
  V' at line 3, query was: CREATE TRIGGER
  codisto_cataloginventory_stock_item_delete AFTER DELETE ON
  cataloginventory_stock   _item FOR EACH ROW

Please see the screenshot for more details

Please help me to resolve this issue.

Thanks!!!


texts: Menu link in adminhtml, ::before pseudoelement before my link

texts:
As you can see from the image, recently a new ::before pseudoelement started appearing near my module link in the admin and I cannot find out where it is being pulled from.

Inspect element:

The module is quite large, so I'm inserting only the menu.xml. But please tell me where to look for possible causes. This wasn't appearing at the beginning, although if I checkout any of my previous commits it still appears. I don't load any css in my module. Cleared cache, recompiled:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Vendor_Module::model"
             title="Module"
             module="Vendor_Module"
             sortOrder="9999"
             resource="Vendor_Module::model"
             parent="Magento_Backend::content"
             action="module/model"
            />
    </menu>
</config>


texts: Adding custom order attribute in order email template

texts:
I created a custom order attribute called security_string And a random string is being generated after a order places using <event> handle sales_order_place_after. String is being generated and it saved into database as well.

Now I have to send this string through order email. So, I have to pass this string to app/local/en_US/template/email/sales/order_new.html.

I extended only sendNewOrderEmail method to  local/Mage like this app/code/local/Mage/Sales/Model/Order.php

<?php

class Mage_Sales_Model_Order extends Mage_Sales_Model_Abstract
{
    public function sendNewOrderEmail()
    {
     /*Existing Code*/
     if ($this->getCustomerIsGuest()) {
            $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
            $customerId = Mage::getModel('customer/customer')->load($this->getCustomerId());
            $securityString = $customerId->getSecurityString();
            $customerName = $this->getBillingAddress()->getName();
        } else {
            $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
            $customerId = Mage::getModel('customer/customer')->load($this->getCustomerId());
            $securityString = $customerId->getSecurityString();
            $customerName = $this->getCustomerName();
        }
        /*Existing Code*/
        $mailer->setTemplateParams(array(
          'order'        =>  $this,
          'billing'      =>  $this->getBillingAddress(),
          'payment_html' => $paymentBlockHtml,
          'securityString'  => $securityString
       ));
        $this->queueNewOrderEmail(true);
        return $this;
    }
}
?>

From email template I am trying to access as {{var order.getSecurityString()}} but unable to get the value, whats wrong with my code?


texts: My Breadcrumbs wont work when on a product page

texts:
I have breadcrumbs displaying at the top of my page perfectly fine and they work perfect as well, I can navigate using them, except when I am on a product page... for some reason they display the correct info but when I'm on a product page I can not click on them to use as a link. When I inspect the element the link src is still showing correctly it just wont let me click.

Here is my breadcrumbs code (started happening after upgrade to 1.9)

<?php
/**
 * Exotern
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade the extension to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.exotern.com for more information or
 * send an email to support@exotern.com .
 *
 * @category    Exotern
 * @package     Exotern_Crumbs
 * @copyright   Copyright (c) 2013 Exotern (http://www.exotern.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

$crumbsLevels = $this->getAllBreadcrumbs();
?>
<?php if($crumbsLevels && is_array($crumbsLevels)): ?>

    <?php foreach ($crumbsLevels as $crumbs): ?>

        <?php foreach($crumbs as $_crumb): ?>
        <li <?php if ((!empty($_crumb['category_id']) || count($crumbs) < 4) && !$_crumb['last']) { ?>typeof="v:Breadcrumb"<?php } ?><?php if (!empty($_crumb['hidden'])) { echo 'style="visibility: hidden;"'; } ?>>
        <?php if(!empty($_crumb['link'])): ?>
            <a href="<?php echo $_crumb['link'] ?>" title="<?php echo $this->htmlEscape($_crumb['title']) ?>" <?php if (!empty($_crumb['category_id'])) { ?>rel="v:url" property="v:title"<?php } ?>><?php echo $this->htmlEscape($_crumb['title']) ?>
        <?php elseif($_crumb['last']): ?>
            <?php echo $this->htmlEscape($_crumb['title']) ?>
        <?php else: ?>
            <?php echo $this->htmlEscape($_crumb['title']) ?>
        <?php endif; ?>
        <?php if(!$_crumb['last']): ?>

        <?php endif; ?>

        <?php endforeach; ?>

    <?php endforeach; ?>

<?php endif; ?>

Thank you


texts:
I need explanation for the different attributes used in webapi.xml in magento2.

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route url="/V1/product" method="GET">
    <service class="Vendor\Module\Api\ProductGetInterface" method="getProduct"/>
    <resources>
        <resource ref="Vendor_Module::product" />
    </resources>
</route>

Like what does route url, service class and resource ref mean?

What value do they have? How to use them?


texts: Magento : Thumbs not Changing Main Image on Mobile View

texts:
When I view site in mobile , below width 770px, the more views thumbs stop working.

Not so fussed about zoom, the problem is thumbs are clickable but don't do anything.


texts:
how to get the module file system path in magento2 for the below?

 require_once(Mage::getModuleDir('controllers','Mage_CatalogSearch').DS.'ResultController.php');
 abstract class Result extends Mage_CatalogSearch_ResultController
 {
    ...
 }

How do I write the same in magento2 ?

What is the equivalent class path in magento 2


texts: Magento on local XAMPP server does not work

texts:
after copying locally on XAMPP my magento I get the attached image

These are the steps that I followed:
Steps for a Magento 1.9 copy in local:
1. Copy all folders
2. Export database from remote server
3. Import database to local server
4. Change URLs in the core_config_data table
5. Change the parameters in the /app/etc/local.xml file
6. Replace .htaccess files (resume the original file, even clean the installation file)


texts: How to check if extension has cronjobs and start them?

texts:
I installed the extension algolia search. But I think its cron job is not running anymore since we moved to another hoster, the term "algolia" is not in the Aoe-Schedueler List.

How can I check if the cronjob of the extension runs and start it if it does not run?


texts:
I have a few customers who are getting 500 errors while placing orders. But else other customers not getting any issue, they are doing checkout without any issue. When 500 status comes I have checked parameters.

  cartId":"4047","billingAddress":{"customerAddressId":"58","countryId":"ZA","regionCode":"Gauteng","region":"Gauteng","customerId":"3524","street":["33
  Ballyclare Drive","Ballywoods Office Park","Cedarwood
  House"],"company":null,"telephone":"+27823716342","fax":null,"postcode":"2191","city":"Johannesburg","firstname":"iHouzit","lastname":"Team","middlename":null,"prefix":null,"suffix":null,"customAttributes":[],"saveInAddressBook":null},"paymentMethod":{"method":"payfast","po_number":null,"additional_data":null,"extension_attributes":{"agreement_ids":["1"]

above all parameters have that customer. Then why it giving 500. Please let me know the solution.


texts: Magento 2.3.2 - Product import duplicates images

texts:
Running Magento 2.3.2 on PHP 7.2

CSV being uploaded has one image for base_image, small_image, thumbnail_image, swatch_image, additional_images.

When products are imported, product images are getting duplicated both in the backend and on the front end as follows.

BACKEND

FRONTEND

I found a possible solution at github https://github.com/magento/magento2/pull/21855

And used this file (there are more than 3000 lines of code, too long to post here)

I replaced the product.php file at

  /vendor/magento/module-catalog-import-export/Model/Import

with the file mentioned above

But when I try and import I get the following error.

  Warning:
  hash_file(/home/xyz/abc/pub/media/catalog/product/v/v/vvg.jpg): failed
  to open stream: No such file or directory in
  /home/xyz/abc/vendor/magento/module-catalog-import-export/Model/Import/Product.php
  on line 1778

How can I fix this issue of image duplication on import.


texts:
I have an observer that rejects this save of orders conditionally and throws a message. Instead of the message I would like to trigger a modal. How can I get this done?

$message = “We were unable to verify your age.”;
throw new \Magento\Framework\Exception\CouldNotSaveException(__($message));
return;


texts: I have already closed my online store on Magento Go. I'm looking for an alternative platform for my ecommerce business.


texts:
I'm having some trouble configuring a multi-site setup for my employer's website.
Our server provider has setup two seperate domains running off the same server and webroot.
I have completed all the requisite steps in the Magento admin panel.
However, when I proceeded to editing the index.php and htaccess files I ran into some issues.
For example:
My index.php currently looks like this:
switch($_SERVER['HTTP_HOST']) {
case 'domain2.com.au':
case 'www.domain2.com.au':
$mageRunCode = 'domain2';
$mageRunType = 'website';
break;
}
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $mageRunCode;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = $mageRunType;
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

The 2nd domain no longer redirects to the main website. However, it presents the following error in the Exception log:

[2021-04-27 03:18:13] main.CRITICAL: No such entity.
{"exception":"[object]
(Magento\Framework\Exception\NoSuchEntityException(code: 0): No
such entity. at
/var/www/html/cyclemotion.com.au/vendor/magento/module-store/Model/GroupRepository.php:70)"}
[]

I can't seem to find much online about this specific issue.
So I would really appreciate the help if anyone has experienced something similar. :)
Thanks.


texts: Magento 2 - custom model save triggers error - Fatal error: Call to a member function dispatch() on a non-object

texts:
I am creating a simple frontend magento 2 module to take input from user and save output in database.

Here is what i have tried.

Index.php -- (Index controller index action)

namespace Companyname\Faq\Controller;
use Magento\Framework\App\RequestInterface;

class Index extends \Magento\Framework\App\Action\Action
{
    public function __construct(\Magento\Framework\App\Action\Context $context) {
        parent::__construct($context);
    }

    /**
     * Dispatch request
     *
     * @param RequestInterface $request
     * @return \Magento\Framework\App\ResponseInterface
     * @throws \Magento\Framework\Exception\NotFoundException
     */
    public function dispatch(RequestInterface $request) {
        return parent::dispatch($request);
    }
}

Add.php -- (Index controller add action)

<?php

namespace Companyname\Faq\Controller\Index;

class Add extends \Companyname\Faq\Controller\Index {
    public function execute() {
    try {
        $params = $this->getRequest()->getPostValue();

        $faq = $this->_objectManager->create('Companyname\Faq\Model\Faq');
        $faq->setData($params);
        $faq->save();
    } catch (\Exception $e) {
            $this->_redirect('*/*/');
            return;
        }
    }

}

?>

Companyname\Faq\Model\Faq.php

namespace Companyname\Faq\Model;

class Faq extends \Magento\Framework\Model\AbstractModel {
    public function __construct() {
    $this->_init('Companyname\Faq\Model\Resource\Faq');
    }
}

Companyname\Faq\Model\Resource\Faq.php

namespace Companyname\Faq\Model\Resource;

class Faq extends \Magento\Framework\Model\Resource\Db\AbstractDb {
    protected function _construct() {
    $this->_init('faq', 'faq_id');
    }
}

i get post data properly and the model also loads correctly with this line - $this->_objectManager->create('Companyname\Faq\Model\Faq');

However, when it tries to save the data, an error gets generated. Fatal error: Call to a member function dispatch() on a non-object in \lib\internal\Magento\Framework\Model\AbstractModel.php on line 663

After a little debugging, i found that it is not getting eventManager inside  \lib\internal\Magento\Framework\Model\AbstractModel.php in this line -  $this->_eventManager->dispatch('model_load_before', $params);

Any clues as to what i am doing wrong ?


texts: Specify encryption key during CLI install?

texts:
Is it possible to set the Magento encryption key when using the magento setup:install command for unattended installation?

There does not appear to be a specific option for the encryption key.  I tried adding --magento-init-params="crypt[key]=$encryption_key", but no luck.

In theory I could use sed or similar to edit the encryption key immediately after installing, but I would prefer to avoid this approach if possible.

Using Magento 2.2.4 on Ubuntu 18.04.


texts: order placing emails not sending to admin

texts:
I am using magento 2.3 for one of my clients. I am facing an issue that one of my customer placed an order. He is receiving the order detail mails. but i had not received the order placed mail.
how can i figure out this issue. I just check the SMTP email logs. In email logs we can only see the mails sent to the customers not to the admin(me).
thank you.


texts:
I'm trying to uninstall a module (my own) that I've installed via composer using CLI with this command:

bin/magento module:uninstall -r [Namespace]_[Module]

Based on the answer provided here by @RyanH I've created the Setup/Uninstall.php file that removes database related data of the module.

This works perfectly but the uninstall procedure hangs.

I've even left the script running over night and still the same result.
The extension files are still there in the vendor module.
I didn't touch the file permissions or owner.

What goes right:

the database related data is removed
the module name is removed from the table setup_module
the module name is removed from app/etc/config.php.

What goes wrong:

the module files are still there in the vendor folder.
the console command does not finish.

Console output:

  You are about to remove code and/or database tables. Are you sure?[y/N]y
  Enabling maintenance mode
  You are removing data without a database backup.
  Removing data of [Namespace]_[Module]
  Removing [Namespace]_[Module] from module registry in database
  Removing [Namespace]_[Module] from module list in deployment configuration
  Removing code from Magento codebase:

After this it just hangs.

Is there anyway to finish the uninstall process, or at least debug it?


texts: How to re-submit form data in custom module?

texts:
I want to get post data in phtml . In case form data not save then show error and already fill form .

 <form class="trail-register-form"
       action="<?php echo htmlspecialchars($this->getUrl().'xxxxxxx/post/register/'); ?>"
       method="post"
       enctype="multipart/form-data">

 <input type="text" name="xxxxx_vehicle_name" placeholder="Vehicle Name" required>

controller.php

$model->setData('xxxx_name', $post['xxxx_name']);
$id =$model->save()


texts:
I'm creating a shipping module, and I need to get current store time and date at the time. in my requirement, I need to check if the day is Friday or not. Then after that, I need to check if time is earlier than 3.30pm (15.30) or not.

I've looked into \Magento\Framework\Stdlib\DateTime\DateTime $datetime but it doesn't provide what I'm looking for.

How can I get store date/time and format it for my requirement? Please help


texts: Can't get customerId when magento tried to retrieve

texts:
I found this error in var/log exception

  main.CRITICAL:Magento\Framework\Exception\NoSuchEntityException: No
  such entity with customerId =  in
  /var/www/html/test.com/public_html/vendor/magento/framework/Exception/NoSuchEntityException.php:45

I though it's the one that made error when customer tried to checkout. I don't know what I must do to fix this, is there a way to fix this?


texts: Change order, invoice & shipment #number

texts:
I have a client that requires custom order, invoice and shipment number to be present in emails and while printing them out... The best possible modification would be to change the code that assigns those numbers.

How would I go about changing this so Magento generates these numbers the way i want them to?

Thank you!!!

Edit:
I'm sory that I wasn't specific enough first time... i don't need a way to change the order increment or starting number but rather change the whole logic of assigning/generating those numbers.

Eg: I would like to have a order number that would be todays date (220114) with a postfix which would be something like the number of todays order (if its the third order today then that postfix wold be 3), invoice number would have additional postfix that would correspond to payment method used and shippment number would a postifx that would describe the shipping method used.

So what i really need is location of the magento code that is responsible for generating current/default numbers and switch that code with my own as needed.


texts: Magento 2.0.2 to magento 2.0.7 upgrade fail during readiness check

texts:
I search on google but not getting any proper solution. Does anyone has any solution for this ?
I am getting this error from admin panel while readiness check for upgrade magento 2.0.7 version.


texts: Can I get information from the magento form through the objectmanager?

texts:
How can I obtaine sales information using the objectmanager and $ _POST.

I attached my code to tell me if it is correct ?

public function tomval(){
        #fucnion que se encarga de hacer la conexion
        $objectmanager = \Magento\Framework\App\ObjectManager::getInstance();
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $day = date(Y,m,d);
        $DeliveryType=  $_POST['DeliveryType'];
        $Address=       $_POST['Address'];
        $Province=  $_POST['Province'];
        $City=  $_POST['City'];
        $PostalCode= $_POST['PostalCode'];
        $Email= $_POST['Email'];

        $Phone= $_POST['Phone'];
        $FirstName= $_POST['FirstName'];
        $LastName=  $_POST['LastName'];
        $PaymentMethod= $_POST['PaymentMethod'];
        $Amount=    $_POST['Amount'];
       /* $Order=   $_POST['']
        $nota=
*/


texts: WARNING ON CATEGORY PAGE: Make sure that "CATNAME"(id:621) category for current store is anchored

texts:
On a Magento 2 website with no products assigned to it yet, I am getting these warnings on category pages.
Make sure that "category name"(id:621) category for current store is anchored
The category is definitely anchored. If I turn Anchor off under Display Settings and then reenable it this usually makes the warning message go away.
I can't find anything about this error. Any ideas?


texts: How can I modify UNIQUE Constraint in table via 'upgradeschema'?

texts:
I want to modify custom field say my_id with constraints UNIQUE KEY in custom extension table.

I have tried with this...

$installer->getIdxName(
            $installer->getTable('test'),
            ['my_id'],
            \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE
        );

How can I do this in Magento2?


texts:
I am tidying up old sites from an EE installation (1.12)

I need to clear the orders from the site as well, static blocks and pages have been easy enough to sort with SQL.

I want to do the same to remove the Orders but I have no idea where to start with how the SQL would be created.

I've tried a bunch of plugins but they seem to not want to work with the old EE version we have.

How do I then remove all orders based on a store? The order IDs should all begin with a 4 letter code (say USEN) which is unique for the store.


texts:
i'm trying to create dynamic cronjob based on my configuration value.
already created group defined in cron_groups.xml

and defined cron task

<group id="mycompany">
    <job instance="Vendor\Module\Cron\Task" method="execute" name="custom_task">
        <config_path>tab/group/field</config_path>
    </job>
</group>

Most strange thing is if i use * * * * * as input value in admin config then i do see my task in cronjob table.

but when i set specific time like 0 0 * * * i don't see it there.

any idea what is wrong ?


texts: how to get dropdown product attribute value in custom xml in magento 2

texts:
I have created custom module and show product data in grid structure using Xml in layout folder. But for dropdown attribute its show value instead of its label.
How to show dropdown attribute label using xml

<block class="module\vendorname\Block\Vendors\Widget\Grid\Column" as="unit">
                  <arguments>
                      <argument name="header" xsi:type="string" translate="true">Units</argument>
                      <argument name="sortable" xsi:type="string">0</argument>
                      <argument name="index" xsi:type="string">unit</argument>
                      <argument name="header_css_class" xsi:type="string">col-units</argument>
                      <argument name="column_css_class" xsi:type="string">col-units</argument>
                  </arguments>
          </block>


texts: How to display star rating into my custom customer feedback grid view using renderer in magento 2?

texts:
This is my listing.xml code for rating . I want to display star rating to the custom feedback grid.

<column name="rating">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                <item name="label" xsi:type="string" translate="true">Rating</item>
            </item>
        </argument>
    </column>

I want Something like this


texts: Magento 2 Pagination for custom collection in Admin Grid using Layout is not working

texts:
I am trying to add an array to collection using DataObject in Admin Grid. The pagination options(html) top of the grid rendered correct but, the grid shows all the records irrespective of the number of rows to be visible per page.

For example i have 100 records, per page count as 20, divided to 5 pages. Navigating to any of the pages shows total 100 records.

class Grid extends \Magento\Backend\Block\Widget\Grid\Extended {
public function __construct(
    Context $context,
    Data $backendHelper,
    \Magento\Framework\Data\Collection $dataCollection,
    array $data = []
) {
    $this->_dataCollection = $dataCollection;
    parent::__construct($context, $backendHelper, $data);
}

protected function _construct() {
    parent::_construct();
    $this->setId('system_grid');
    $this->setSaveParametersInSession(true);
    $this->setDefaultSort('id');
    $this->setDefaultDir('ASC');
    $this->setLimitVarName('limit');
    $this->setPageVarName('page');
}

protected function _prepareCollection() {
     $data = [
        [
            'id' => 1,
            'product_name' => "Some Value"
        ],
        [
            'id' => 2,
            'product_name' => "Some Another Value"
        ],
        ........100 records
    ];
    $collection = $this->_dataCollection;
    foreach ($logData as $data) {
        $varienObject = new \Magento\Framework\DataObject();
        $varienObject->setData($data);
        $collection->addItem($varienObject);
    }

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

Can anyone please help to resolve the pagination issue?


texts: Magento 2 : Remove Media And Product Info Block for Particular Product Type

texts:
I want to remove media block and product info block from PDP Page of particular product type. If I use in the following way,
<referenceBlock name="product.info.media" remove="true" />

then the media block gets removed from all the pages. But it should remove from only particular product type. In block, I made a check for productType in following way,

public function _toHtml()
{
    if (true) {
        return parent::_toHtml();
    }
    return '';
}

But this is not working out. So how can I remove media and info blocks in PDP Page for particular product Type.


texts: magento2: unable to save text swatch attribute, "Admin is a required field in the each row"

texts:
on Magento2.2.3 unable to save text swatch attribute, getting error

"Admin is a required field in the each row":

Value is not Zero.

Only possible way to save it is to change type to dropdown or visual swatch, add value, save it and then change it back to text swatch, but i'd like to understand how to fix it, not workaround.


texts: How can i write the zipcode validation by selected country in magento checokut page.?

texts:
For Ex:in Checkout Page
selected country - USA
Zipcode - 500018

if 500018 is not available in USA show an error like "Please Enter Valid Zip code" or "This Zipcode is Not availble in Selected Country".


texts: Magento - Use symbolic links - Don't work correctly - why ?

texts:
I'm trying to have a magento structure to we can use in multiple sites, like I do with other products like Drupal.

I'd like to have :

index.php ----> [path]/index.php

where index.php is not a file. Is a symbolic link what point to file.

When I try to load this index.php in version 2.1 directly dont work and in version 1.9 don't work admin form.

Why ?

Is possible to have index.php as a link ?

Thanks.

Ricardo / Brqx.


texts: Rewrite Tool: rewrite url with parameters

texts:
I have a url like:

shop/artikel_solo.php?abc=1 that needs to become myurlslug-of-the-article1.html
shop/artikel_solo.php?abc=2 that needs to become myurlslug-of-the-article2.html
and so on.

How to tell Magento to respect the query string while rewriting the url?

I also tried this solution: https://community.magento.com/t5/Programming-Questions/Magento-Redirect-Loses-URL-Querystring/td-p/4608 but I don't think it  is acutally the right one.


texts: Dependency Injection: How to define constructor when framework class gets overwritten

texts:
I've recently created a module for Magento 2 which depends on various Magento framework classes through dependency injection like so:

// Vendor\Module\Helper\Debug
public function __construct(
    \Magento\Framework\App\Helper\Context $context,
    \Magento\Framework\Mail\Message $message,
    \Magento\Framework\Mail\Transport $transport,
    \Vendor\Module\Helper\Config $configHelper
) {
    ...
    parent::__construct($context);
}

This worked well until a third party module was installed that overrides the Message and Transport Framework classes in their di.xml:

<preference for="\Magento\Framework\Mail\Message" type="OtherVendor\Module\Model\Message"/>
<preference for="\Magento\Framework\Mail\Transport" type="OtherVendor\Module\Model\Transport"/>

Now my Module returns the following error

Recoverable Error: Argument 2 passed to Vendor\Module\Helper\Debug::__construct() must be an instance of Magento\Framework\Mail\Message, instance of OtherVendor\Module\Model\Message given

I've already tried deleting the var/generation folder, as well as refreshing and subsequently disabling the Magento cache.

What can I do to change my constructor so that it works either way? So by using either the Magento\Framework\Mail\Message core class or the override class by the third-party module.


texts: Magento Fails to Create Session and Shows Blank Screen After Login

texts:
Hi Struggling with this one, done some reading and tried checking for blank spaces at the end of files. I actually removed a few but this didn't fix the issue even after clearing the cache.

The system is not creating any session data. There is nothing in var/session

Here is the error that magento is reporting:

a:5:{i:0;s:126:"Cannot send headers; headers already sent in app/code/core/Mage/Admin/Model/Session.php, line 1";i:1;s:1409:"#0 lib/Zend/Controller/Response/Abstract.php(148): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 app/code/core/Mage/Core/Controller/Response/Http.php(106): Zend_Controller_Response_Abstract->setRedirect('http://planetto...', 302)
#2 app/code/core/Mage/Adminhtml/Controller/Action.php(348): Mage_Core_Controller_Response_Http->setRedirect('http://planetto...')
#3 app/code/core/Mage/Adminhtml/Controller/Action.php(182): Mage_Adminhtml_Controller_Action->_redirect(Object(Varien_Simplexml_Element))
#4 app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#5 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#6 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#8 app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 index.php(90): Mage::run('', 'store')
#10 {main}";s:3:"url";s:6:"/admin";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

Look forward to getting any help.


texts: avoid sending mail in newsletter success when customer create new account

texts:
how to avoid sending mail in newsletter when customer created new account.
when we register on site at that time we get 2 mails , first is welcome mail and another is newsletter subscribe. we need to stop sending this second mail .


texts: How to prevent magento duplicate meta title and meta description on google webmaster tools

texts:
Anyone please help.
I'm trying to stop duplicate title and description on Google webmaster tools.
1. I already turn on Use Canonical Link Meta Tag For Categories and Use Canonical Link Meta Tag For Products

http://www.siamcase.com/

Use Web Server Rewrites >> yes
generate a new sitemap >> done
block url by robot.txt
http://www.siamcase.com/robots.txt

I think i have did everything correctly. But Google webmaster tools still show me a duplicate title and description. I don't know maybe the problem came from a robots.txt or not.

I have updated my robot.txt last week. and Google already get Last updated on Jun 17, 2013
Kindly Please help me to fix this problem.


texts: How do i remove remove SORT BY Price, Position, Name in Magento 2.1?

texts: How do I remove the SORT BY Price, Position, Name in Magento 2.1?


texts: Maganto 2 | Does guest customer Id exists ? if yes how can we get through Order collection or some other way?

texts:
I am getting guest customer Collection with:

\Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory

as:

public function getGuestOrderCollection()
  {
   $orderCollecion = $this->_orderCollectionFactory->create()->addFieldToSelect('*');
   $orderCollecion->addAttributeToFilter('customer_is_guest', ['eq'=>1]);
   return $orderCollecion;
  }

Currently I am not getting ID for guest customer by this but it works without guest customer:

$Id = $_order->getId();

I am looking to change guest customer information by this. Can any body help  me to now about it. Thanks


texts: Where to find Orders details page frontend magento 2

texts: I want to change the design of Orders details page in magneto 2 frontend, but I don't know which page to edit. Is it in module-sales?


texts: upgrade cloud enterprise edition with specific steps

texts: I want to upgrade cloud enterprise edition from 2.3.2-p2 to 2.4.2 but not getting proper steps so anyone can guide me for same.


texts: show two prices for same product , one for at store and another for ship to home

texts:
I want to show two prices for same product.
one price will be "ship to home price" and another will be "At store price".
How can i do it and also what changes are required in template to show both.
My website is www.way2pets.com


texts: Is there any option to add custom attributes in customer registration form from admin panel?

texts:
I wish to create new fields in the customer registration form. I just wanted to know whether there is any option to create it from Magento admin panel.

Kindly guide me as am new to magento.


texts: Need to export the products but the export file is not creating in var\export

texts:
I am trying to export the products in Magento 2.3.5 there are more than 2Lakh products in the store. After I click the continue I got the below message and i also ran the bin\magento cron:run command

"Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file"

But the customer export is working properly.
Doubts:

Is there any limit for product export?


texts: Use Entity as Attribute of another Entity in Magento

texts:
I'm going to follow this tutorial but my question is.. is it possible to use an EAV Entity as attribute of a new EAV Entity?

Thanks.

EDIT: The tutorial that I originally posted is quite messed up and I ended up following this other tutorial instead.


texts:
I have a strange, useless and a way funny error like Magento know how to do. When executing php bin/magento setup:di:compile:

  Firebear\ImportExport\Model\Import\Address
                  Incompatible argument type: Required type: \Magento\Customer\Model\ResourceModel\Address\Attribute\CollectionFactory.
  Actual type:
  \Magento\Customer\Model\ResourceModel\Address\CollectionFactory; File:
  /var/www/MyWebSite/magento/app/code/Firebear/ImportExport/Model/Import/Address.php

  Total Errors Count: 1

  In Log.php line 92:
                                 Error during compilation

For me this error looks like :
Magento: "I want CollectionFactory"
Firebear import export extension : "ok I give you CollectionFactory"
Magento: "nope error"
So if someone sees something else please tell me, it would be really useful for me.
PS: in case of Minus please let me know why so that I can improve my post.


texts: How Many System Config Options Is Too Much

texts:
I'm rebuilding a theme. The current one I'm replacing has over 400 options in the system configuration options. I do realise that 400 is ridiculous, but I always make use of system config in my own themes.

My question; how much is too much? I'm thinking of this especially from a performance perspective, are the system config variables cached? I realise also that this is open to opinion. Thanks.


texts:
Right Now I'm facing issue to set base url in magento CMS page layout. Right now I'm doing like this,but  I am not getting base url :

<action method="addCrumb">
    <crumbName>Home</crumbName>
    <crumbInfo>
        <label>Home</label>
        <title>Home</title>
        <link> {{store url}} </link>
    </crumbInfo>
</action>


texts: Cookies is not saving when page cache is enable for magento 2

texts:
I am saving cookies in controller by getting post data to from custom form.
Issues is cookies is not saving when page cache is enable.

$this->_cookieManager->setPublicCookie(
                         self::year,
                         $year,
                         $metadata
                    );

This is a controller where code is written.

Anyone have a solution?
Page cache creating a issues for me.
Advanced Thanks


texts:
I am trying to create a custom controller in admin side.

My config file as below:

<admin>
        <routers>
            <salesref>
                <use>admin</use>
                <args>
                    <module>Ucs_Order</module>
                    <frontName>salesref</frontName>
                </args>
            </salesref>
        </routers>
    </admin>

My Controller located in below:

app\code\local\Ucs\Order\controllers\Adminhtml\ReferenceController.php

Content of my controller as below,

<?php

class Ucs_Order_Adminhtml_ReferenceController extends Mage_Adminhtml_Controller_Action
{

    public function indexAction()
    {
        echo 'Test';
        die;

    }
}

Then I am trying to access the URL as below,

http://192.168.100.68/magento/index.php/salesref/adminhtml_reference/index

But It automatically redirects to dashboard,

Whats the problem with my code?


texts: Unable to serialize value problem with Magento 2.2.6

texts:
Please teach in order to solve the problem.

cd /vagrant
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:di:compile
sudo php bin/magento setup:static-content:deploy
sudo php bin/magento setup:static-content:deploy ja_JP
sudo php bin/magento cache:flush;
sudo php bin/magento cache:clean
sudo php bin/magento indexer:reindex
sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
sudo chown -R :www-data .
sudo chmod u+x bin/magento

  1 exception(s):
      Exception #0 (InvalidArgumentException): Unable to serialize value.

Exception #0 (InvalidArgumentException): Unable to serialize value.
#0 /vagrant/vendor/magento/framework/App/PageCache/Kernel.php(153):

  Magento\Framework\Serialize\Serializer\Json->serialize(Array)
      #1 /vagrant/vendor/magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php(96):
  Magento\Framework\App\PageCache\Kernel->process(Object(Magento\Framework\App\Response\Http\Interceptor))
      #2 /vagrant/vendor/magento/framework/Interception/Interceptor.php(146):
  Magento\PageCache\Model\Controller\Result\BuiltinPlugin->afterRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor),
  Object(Magento\Framework\View\Result\Page\Interceptor),
  Object(Magento\Framework\App\Response\Http\Interceptor))
      #3 /vagrant/vendor/magento/framework/Interception/Interceptor.php(153):
  Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
      #4 /vagrant/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(26):
  Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult',
  Array, Array)
      #5 /vagrant/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
      #6 /vagrant/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()
      #7 /vagrant/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
      #8 {main}


texts:
How to use knockout js in Magento 2 admin sales order creation?

I did the same way like frontend but my code is not working.

Kindly help me, if you have used knockout js for admin.


texts: How to get the sales order date from the REST api?

texts:
I am facing a very puzzling aspect of the REST API of Magento. Seemingly, the GET /Orders response does not return any date. This can't be right, sales orders are dated.

What am I missing here?


texts:
How to disable Custom order status button  after change the status.

If i click rto button after that button should be disabled?

    $message = Mage::helper('sales')->__('Are you sure you want to Change Status?');
 $block->addButton('Shipement',
array( 'label' => Mage::helper('sales')->__('Shipement'),
'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('orderstatus/adminhtml_index/shipement')}')", 'class' => 'go' ));

$block->addButton('rto',
array( 'label' => Mage::helper('sales')->__('RTO'),
'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('orderstatus/adminhtml_index/rto')}')", 'class' => 'go' ));

$block->addButton('completed',
array( 'label' => Mage::helper('sales')->__('Complete'),
'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('orderstatus/adminhtml_index/complete')}')", 'class' => 'go' ));


texts:
We want to edit the Magento2 Luma header template, this so we can change the sort inside

We want to place the block search before the minicart for example and place the logo block inside a new

Where can we find the right template files for this?

So to change this:

Into this:


texts:
I'm trying to catalogSearch products by category but it's giving me inaccurate results like products that are not in the category, i have set to "No" searchable description ,reindex catalog search index and search type to "Fulltext""

Is there any other options of search catalog in magento ?


texts:
I have a product with custom option using text field, I'd like a validation to it so that only letters is allow i.e. just like those "required field", alert message will pop up if your input it not accepted.

I have been looking around for hours to see where is the option-list located but with no luck.


texts: How Magento generates Product Images Cache?

texts:
We have uploaded the product images via Magento 2 admin-panel for our client site. For checking purpose, we have downloaded the image (which we have uploaded) from the front-end of the site. Upon checking, we have noticed that the size of the product image (original size is 530KB) reduced to 230KB.

While we investigate this, we have seen that the image which was appeared on the front-end was from product cache.

So, my question is, why the product cache images are displaying instead of the original size of the image?

Looking forward to hearing from you.


texts:
I have installed magento2.1 in local pc. After I created one custom theme then, I Go to change my custom theme via admin Store -> Configuration -> General -> Design  But Here Theme Selection option is not there , Is magento 2.1 Bug?

Reference:


texts:
Am using Magento 1.9.3. Here am creating a custom order gird in admin->sales->order table, those columns following

Coupon Code
Sliver Exchange Declaration

In Coupon Code is used to showing coupon_code name for the order.

And Sliver Exchange Declaration is showing some link

for the more info for following image

My query i would like to show Silver Exchange Declaration when coupon code = SE50 otherwise don't show the Sliver Exchange Declaration

My codes
app\code\core\Mage\Adminhtml\Block\Sales\Order\Grid.php

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->joinLeft(array('order' => Mage::getModel('core/resource')->getTableName('sales/order')),
        'order.entity_id=main_table.entity_id',array('silver_exchange' => 'coupon_code'));
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

In protected function _prepareColumns()

$this->addColumn('coupon_code', array(
          'header'    => Mage::helper('sales')->__('Coupon Code'),
          'align'     =>'left',
          'width'     => '50px',
          'index'     => 'silver_exchange',
          'filter'    => false,
          'sortable'  => false,
        )); //code for coupon_code

$this->addColumn('silver_exchange', array(
                'header' => Mage::helper('sales')->__('Sliver Exchange Declaration'),
                'index' => 'silver_exchange',
                //'filter_index' => 'payment.method',
                //'type'  => 'options',
                //'options' => $silver_exchange,
                'width' => '170px',
                'filter' => false,
                'sortable'  => false,
                'type'      => 'action',
                'actions'   => array(
                        array(
                            'caption' => Mage::helper('sales')->__('Silver Exchange Declaration'),
                            'url'     => array('base'=>'*/sales_order/declaration'),
                            'field'   => 'order_id',
                            'data-column' => 'action',
                        )
                    ),
                )); //code for Silver Exchange Declaration

  query is if coupon code is SE50 showing Silver Exchange Declaration link


texts: how to change the order of aggreation filter in magento 2 in di.xml

texts:
Magento/Cataloggraphql/etc/graphql/di.xml

 <type name="Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\LayerBuilder">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="price_bucket" xsi:type="object">Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Price</item>
                <item name="category_bucket" xsi:type="object">Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Category</item>
                <item name="attribute_bucket" xsi:type="object">Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Attribute</item>
            </argument>
        </arguments>
    </type>

here based on this

filter layer (aggregations) in magento 2

showing

  price

  category

  custom_attributes

here

i want to change the order of this

expected result
(order only changed)

  category

  price

  custom_attributes

i tried to copy to my custom module but

don't change in order

when i change order in core file
it working as expected.

how i can achieve this?


texts: Magento 2: How do you compile with you only what you want with "setup:static-content:deploy"?

texts:
How do you compile with you only what you want with "setup:static-content:deploy" ?
How can compile only current theme ?
How can compile only .less files of theme ?


texts: How to set discount code for one country using only?

texts:
Can anyone help to teach me how to set specific discount code only for specific country only?

Thanks!


texts: How to use Magento 2 SOAP API from Python?

texts:
I am trying to fetch all the orders and customer from Magento 2 to my python based application. But I am not able to get any API to use in Python.

Anyone who has used Magento 2 SOAP API in python, please let me know.


texts: Magento 2.3.1 import images with external link still not working

texts:
trying to pull image from external url during import but get:

"1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 2"

here is the link...
https://media.server.theshootingwarehouse.com/large/48217.jpg

I only have two products to test..
I exported products... edited the CSV to add the above url to the base_image column.

I have tried with and without https://
I get the same errror.. I am on M2 2.3.1


texts: How to make Magento 2 log timestamp follows locale configuration?

texts:
How can i make exception.log, system.log, , debug.log or any other log inside var/log which is generated from magento 2 follows the configuration timestamp, right now it is showing the utc timezon in the log timezone, how can I set ti to UTC+5 just like my locale configuration in Magento 2 ?
I'm using Magento ver2.4.1


texts: currency not updating when changing currency

texts:
I don't understand why currency is not working properly.

I have kept base currency as INR and When choosing the USD or Euro Or GBP, its still shows the base Indian rate and uses the currency symbol of other currencies.

Please check attached files.


texts: Configurable product overrides simple products qty increments

texts:
I have a client who uses configurable products to allow customer to chose between a series of simple products. Magento has a default feature for "Qty increments", which limits the quantities allowed to purchase to products of the value specifier. I.e. if you set "Qty increments" to 5, you're allowed to buy 5,10, 15 etc.

My issue is that the "Qty increments" specified for the configurable product overrides that of the simple products. Is it possible to change this, so that the "Qty increments" of the simple products are used instead?


texts: How to make a call in Magento to an external web service?

texts:
I want to call an external web service when user find a product by CatalogSearch. Any idea to do this? I have a SOAP function to call at my ERP, but i don\’t know where i can put this function to call my web service.

Exactly I have a product catalog in my ERP. In Magento users search SKU number in the search input of the header in the Magento catalog search, and i would like to find the product with that SKU in my ERP.

This is what I'm told in another forum. What do you think?

The easiest way is probably to :

Create a Magento Module;
Create a new Helper;
Add your ERP function to the Helper;
Call your helper function (something like Mage::getHelper('path/to/helper')->MyERPFunction();


texts: Custom module menus are not showing in another user account

texts:
My custom module is not showing its menus in another user role account.

Here is the adminhtml.xml--

<?xml version="1.0"?>
<config>
    <menu>
        <kartparadigm_storecredit module="kartparadigm_storecredit">
            <title>Store Credit</title>
            <sort_order>71</sort_order>
            <children>
                <settings module="kartparadigm_storecredit">
                    <title>Settings</title>
                    <sort_order>0</sort_order>
                    <action>adminhtml/credits/settings</action>
                </settings>
                <customers module="kartparadigm_storecredit">
                    <title>Manage Customer Credits</title>
                    <sort_order>0</sort_order>
                    <action>adminhtml/credits/customer</action>
                </customers>
                <transactions module="kartparadigm_storecredit">
                    <title>Manage Transactions</title>
                    <sort_order>0</sort_order>
                    <action>adminhtml/credits/index</action>
                </transactions>
            </children>
        </kartparadigm_storecredit>
    </menu>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <storecredit translate="title" module="kartparadigm_storecredit">
                        <title>Credits</title>
                        <sort_order>300</sort_order>
                        <children>
                           <transactions translate="title" module="kartparadigm_storecredit">
                             <title>Manage Transaction</title>
                             <sort_order>1</sort_order>
                           </transactions>
                           <customers translate="title" module="kartparadigm_storecredit">
                              <title>Manage Customer Credits</title>
                              <sort_order>2</sort_order>
                           </customers>
                           <settings translate="title" module="kartparadigm_storecredit">
                                <title>Settings</title>
                                <sort_order>3</sort_order>
                           </settings>
                        </children>
                     </storecredit>
                     <system>
                        <children>
                            <config>
                                <children>
                                    <mycustom_section translate="title" module="kartparadigm_storecredit">
                                        <title>My Custom Section</title>
                                        <sort_order>100</sort_order>
                                    </mycustom_section>
                                </children>
                            </config>
                        </children>
                     </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

I have also used this code in controller--

protected function _isAllowed()
{
        return true;
}

Although it is showing in Role Resources as below image--

But when I login with  different account it does not show menus.
I can't find out where is the problem. can anyone help me ?


texts: How to change coupon error message in magento 2.3 accourding to conditions

texts:
I want to show message "Coupon already used" If coupon limit/used by customer instead of "The coupon code isnt valid."

But Didnt know how to add this condition.
Thank you in advanced.


texts: How do I change in bulk the base image of a product to an existing image? I have images that were changed from an image to a non-existing (null) image and it made the product page not display the images in the gallery. I've discovered that when an image is set as the base image... the gallery come back. I've tried uploading one through the data flow, but that only creates a new image with the same image. I haven't tried the SQL or ORM route.


texts: Magento 2: Changing Price of Product in Controller doesn't work at the moment!

texts:
I tried to change the Price of my Products like this:

  Controller.php:

[EDIT]

   <?php

namespace MassiveArt\ShoppingCart\Controller\Index;

use Magento\Catalog\Model\ProductFactory;
use Magento\Checkout\Model\Cart;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\Data\Form\FormKey;

class Index extends Action
{
    /**
     * @var FormKey
     */
    protected $formKey;

    /**
     * @var Session
     */
    protected $checkoutSession;

    /**
     * @var Cart
     */
    protected $cart;

    /**
     * @var ProductFactory
     */
    protected $productFactory;

    /**
     * Constructor.
     *
     * @param Context                         $context
     * @param \Magento\Checkout\Model\Session $checkoutSession
     * @param \Magento\Customer\Model\Session $customerSession
     * @param JsonFactory                     $resultJsonFactory
     * @param FormKey                         $formKey
     * @param Cart                            $cart
     * @param ProductFactory                  $productFactory
     */
    public function __construct(
        Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Customer\Model\Session $customerSession,
        JsonFactory $resultJsonFactory,
        FormKey $formKey,
        Cart $cart,
        ProductFactory $productFactory
    ) {
        $this->checkoutSession = $checkoutSession;
        $this->customerSession = $customerSession;
        $this->formKey = $formKey;
        $this->resultJsonFactory = $resultJsonFactory;
        $this->cart = $cart;
        $this->productFactory = $productFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        try {

            // Set result data and pass back
            $result = $this->resultJsonFactory->create();

            $allItems = $this->checkoutSession->getQuote()->getAllVisibleItems();
            foreach ($allItems as $item) {
                $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
                $price = 100; //set your price here
                $item->setCustomPrice($price);
                $item->setOriginalCustomPrice($price);
                $item->setSubtotal($price);
                $item->getProduct()->setIsSuperMode(true);
            }
            $this->checkoutSession->setTotalsCollectedFlag(false);
            $this->checkoutSession->getQuote()->save();
            $this->checkoutSession->getQuote()->setTotalsCollectedFlag(false);
            $this->setTotalsCollectedFlag(false);

            $result->setData(['message' => __("Products added succesfully")]);

            return $result;
        } catch (\Exception $e) {
            $result->setData(['error' => __($e->getMessage())]);
            return $result;
        }
    }
}

(EDIT)
With the new code the price changes, but the subtotal not! As you can see here:

Thanks in advance!


texts: Fatal error: Call to a member function isPathAllowed() on a non-object in /Filter.php on line 498

texts:
I ran into an issue while upgrading magento from version 1.9.2.1 to 1.9.2.2

I am getting this error

  Fatal error: Call to a member function isPathAllowed() on a non-object
  in
  /magento/var/cache/ew/files/7e/e0/Mage/Core/Model/Email/Template/Filter.php
  on line 498

Can any one guide me how i can solve this problem
Thanks in advance for your help.


texts: Magento 2 : Product custom options are getting duplicated

texts:
I am creating product custom options using the following code
foreach ($options as $arrayOption) {
    $product->setHasOptions(1);
    $product->setCanSaveCustomOptions(true);
    $option = $objectManager->create('\Magento\Catalog\Model\Product\Option')
                            ->setProductId($product->getData('row_id'))
                            ->setStoreId(2)
                            ->addData($arrayOption);
    $option->save();
    $product->addOption($option);
}

But it is resulting in duplication of the same custom option

There is a similar question but in magento 1: Product custom option duplication on save within loop
How to resolve the same for Magento 2?


texts: Production server unable to add or modifiy products

texts:
I have move my site to dev server to production server every thing working fine but unable to add products

I have get bellow error "Provisional headers are shown"  (See in firebug the script are running without response")

IN REQUEST HEADER

Request Headers
Provisional headers are shown
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryhOwWpY5AtD644oAG


texts:
I have added new fonts in <my theme>/web/fonts, and declared those fonts in <my_theme>/web/css/source/_typography.less. But still my custom fonts not reflecting in my pages.

I'm missing any configurations? anybody have idea over here?


texts: Using Magento 1.9.1 CE, ElevateZoom doesn't work on product page (Uncaught TypeError: undefined is not a function)

texts:
So, just noticed that when I clicked on product thumbnails on the product view page of my magento, clicking the thumbnails don't do anything (instead it scrolls to top). This is the error I get in console:

Chrome: Uncaught TypeError: undefined is not a function
Firefox: TypeError: image.elevateZoom is not a function

Line 1194 of rwd/default/js/app.js:

image.elevateZoom();

Any idea why this isn't working? As far as my theme goes, it's a very minimal theme that heavily falls back on the RWD Theme in magento 1.9.1. I'm using Easy Tabs on the product view page, but I tried disabling it to see if it worked... no dice.

Update:

What I've Tried:

I've disabled magento cache
Tried adding a custom js file with jQuery.noConflict(); in it via my local.xml immediately after (@AreDubya's Suggestion).
Removed custom js file from my local.xml after it didn't work.
Tried copying the same theme to another magento installation on the same host- elevateZoom works fine on that one... both these sites are pretty vanilla as far as extensions go.

My Local.xml

<layout version="0.1.0">
    <default>
        <reference name="right">
            <remove name="right.permanent.callout"/>
            <remove name="paypal.partner.right.logo"/>
            <block type="cms/block" name="right_info_block" before="-">
                <action method="setBlockId"><block_id>right_info_block</block_id></action>
            </block>
        </reference>
        <reference name="head">
            <action method="removeItem"><type>skin_js</type><name>js/slideshow.js</name></action>
            <action method="removeItem"><type>skin_js</type><name>js/lib/jquery.cycle2.min.js</name></action>
            <action method="removeItem"><type>skin_js</type><name>js/lib/jquery.cycle2.swipe.min.js</name></action>
            <action method="removeItem"><type>skin_css</type><name>css/madisonisland.css</name></action>
            <action method="removeItem"><type>skin_css</type><name>css/madisonisland-ie8.css</name></action>
            <action method="removeItem"><type>link_rel</type><name>//fonts.googleapis.com/css?family=Raleway:300,400,500,700,600</name></action>
            <!-- <action method="addItem"><type>skin_js</type><script>js/lib/hivarian.js</script></action> -->
        </reference>
        <reference name="footer">
            <remove name="footer_links"/>
            <remove name="footer_links2"/>
        </reference>
    </default>

    <!-- Mage_Catalog -->
    <catalog_product_view>
        <reference name="head">
            <action method="addItem"><type>skin_js</type><script>js/lib/elevatezoom/jquery.elevateZoom-3.0.8.min.js</script></action>
        </reference>
        <reference name="product.info.additional">
            <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
            <remove name="catalog.product.related" />
            <remove name="catalog.product.additional" />
        </reference>
    </catalog_product_view>

</layout>


texts: Need to Initialization js while ajax response magento 2

texts:
Need to Initialization js for particular div when the div append ajax response magento 2.

i have append the div in ajax response and also i need initialize js for that div.

How to do that


texts: I need to add a custom tab in catalog edit page of admin and need to display a custom grid collection under the tab in magento2.1.1 version

texts:
I need to add a custom tab in catalog edit page of admin and need to display a custom grid collection under the tab.

Please find my code below:

  catalog_product_edit.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product_form">
            <block class="Test\Demo\Block\Adminhtml\Catalog\Product\Edit\Tab\Demo" name="demo.tab">
                <arguments>
                    <argument name="config" xsi:type="array">
                        <item name="label" xsi:type="string" translate="true">Demo Tab</item>
                        <item name="collapsible" xsi:type="boolean">true</item>
                        <item name="opened" xsi:type="boolean">true</item>
                        <item name="sortOrder" xsi:type="string">2</item>
                        <item name="canShow" xsi:type="boolean">true</item>
                        <item name="componentType" xsi:type="string">fieldset</item>
                    </argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

  Test/Demo/Block/Adminhtml/Catalog/Product/Edit/Tab/Demo

<?php
namespace Test\Demo\Block\Adminhtml\Catalog\Product\Edit\Tab;

use Magento\Backend\Block\Template\Context;
use Magento\Framework\Registry;

class Demo extends \Magento\Framework\View\Element\Template
{
    /**
     * @var string
     */
    protected $_template = 'product/edit/demo.phtml';

    /**
     * Core registry
     *
     * @var Registry
     */
    protected $_coreRegistry = null;

    public function __construct(
        Context $context,
        Registry $registry,
        array $data = []
    )
    {
        $this->_coreRegistry = $registry;
        parent::__construct($context, $data);
    }

    /**
     * Retrieve product
     *
     * @return \Magento\Catalog\Model\Product
     */
    public function getProduct()
    {
        return $this->_coreRegistry->registry('current_product');
    }

}

  product/edit/demo.phtml

<?php

echo 'Test contents of new tab';

?>

Here I am able to display content in the demo.phtml.

But I need to load a custom grid with its actions like filter, serach etc.

How can I load a custom admin grid in the new custom tab created in admin catalog edit page?


texts: Mangeto Admin and website display changed after changing web section in config, Magento 1.X

texts:
I was trying to optimize my magento site and for that I made a few changes within my admin section:

First under :

System > Config > Web > Session Cookie Management

I had set the  Cookie Domain  to "www.semipreciousking.com" which was blank earlier, and I also made changes to:

System > Config > Web > Secure > Base Media URL

I changed this section to the CNAME which I created for static content,

earlier it was like this:

{{secure_base_url}}media/

I changed it to this:

https://www.image.semipreciousking.com/media/

Since I created and CNAME of image.semipreciousking.com, and someone mentioned to do it this way and I did, but as soon as I made changes, the admin panel and the site display changed and the save button in admin panel has stopped functioning because of which I was unable to redo all the changes. All the media files within the site and the admin section have stopped functioning because of that.

Can you please help me with that?

Will really appreciate your help.


texts: Choosing dedicated server for Magento CE 1.9.2.1

texts:
I am thinking to rent following dedicated server for my Magento shop:

Intel XEON E5-1650v2 (6 x 3,5 GHz)
64 GB DDR3
2 x 1.000 GB SATA
Software-Raid
KVM Remote Management (iLO)

What I miss here is the SSD, DDR4 Ram and hardware Raid. My question is whether I need those mentioned and how big impact would they have on server performance, how much would the lack of hardware Raid and SSD reduce the performance of the dedicated server.

Second option is:

Intel i7-4790k 4.0 GHz
32GB DDR3 Ram
2 TB HDD or 2x 120 GB SSD
Hardware Raid for additional price otherwise SW Raid included

My concer here is that the CPU is not server graded but it is desktop CPU. I would rather have Xeon than the above but please help me give me some input.


texts:
I want to remove the SalesRule from Quote if rule Coupon type is

  Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON

I have this code:

    $event = $observer->getEvent();
    $quote = $event->getQuote();
    $address = $quote->getShippingAddress();
    $appliedRule = $event->getRule();

    if (strlen($quote->getCouponCode()) > 0) {
        $quote->setCouponCode('');
        $quote->collectTotals()->save();
    }

    return $this;

which works fine if I want to remove the Coupon code which I set in the salesRule. But same rule does not work for Coupon type which I have mentioned above.

I have tried solutions like iterating through quote Items and setting the appliedRules to null and discount amount, value to zero but nothing worked. E.g.

    $event = $observer->getEvent();
    $quote = $event->getQuote();
    $address = $quote->getShippingAddress();
    $appliedRule = $event->getRule();

    $giftcards = $quote->getGiftCards();
    $giftCardsData = unserialize($giftcards);

    if ($appliedRule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) {
                foreach($quote->getAllVisibleItems() as $item) {
                    $item->setAppliedRuleIds('');
                    $item->setDiscountPercent(0);
                    $item->setDiscountAmount(0);
                    $item->setBaseDiscountAmount(0);
                    $item->save();
                }
            }

Or also tried setting AppliedRules to null in QUOTE and ADDRESS:

if ($appliedRule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) {
            $address->setAppliedRuleIds('');
            $quote->setAppliedRuleIds('');
        }

But no success so far. I will be great full if someone can tell me how can I remove the SalesRule from the Quote.

By the way above code is running under

  salesrule_validator_process

Event.


texts: How can i put default top menu item inside custom header in magento 2

texts:
I am new in magento 2. i am facing a problem with default top-menu block. I create a custom header and i want to move top-menu block in my custom header. But not get success
Code:

Custom header file :

  <?php //echo $this->getChildHtml("logo"); ?>

                <?php echo $this->getChildHtml("catalogTopnav"); ?>

layout/default.xml

<referenceContainer name="header.container">
             <block class="Magento\Framework\View\Element\Template"
              name="custom_header" as="custom_header"
              template="Magento_Theme::html/customheader.phtml"  before="-" /></referenceContainer>
<move element="catalog.topnav" destination="custom_header" after="logo" />

Please help me any one how to print top menu item in my custom header. thanks in advance


texts:
I'm implementing a mobile app that would communicate with Magento, there is a lot of functions/endpoints not implemented in SOAP or REST api, so im definitely going to extend whichever im going to consume. But the question is which should i use,

The REST api apparently needs oAuth and end-user authroization, and from i understand there is no way to bypass this. But i dont want to do that, I just want to access the api and start firing request without the user authorization or prompting him with a dialog.
From what i read the SOAP fits better with what im doing here, it just needs an api user and key.

Can you guys confirm this, should i go for the SOAP and extend it when needed.

Regards.


texts: The changes I do in back-end panel doesn't reflect in front-end.

texts: I am new to Magento. I am trying to configure a Magento Site that runs 1.8 version. I want to provide free shipping to customers only if the order value is above 300, else charge 30 per delivery. I tried configuring Flat Rate, Free shipping, and even tried to add a rule. But the changes are not reflected in front end. There is only one Shipping method called "Standard Shipping" that does not charge any amount for shipping. Could anyone help me in this?


texts:
I export Custom csv to the product

public function exportmeAction(){
      try{

    $products = Mage::getModel("catalog/product")->getCollection();
            $products->addAttributeToSelect('category_ids');
            $products->addAttributeToSelect('*');
            $products->addAttributeToFilter('status', 1);//optional for only enabled products
            $products->addAttributeToFilter('visibility', 4)
            ->joinField('qty',
                             'cataloginventory/stock_item',
                             'qty',
                             'product_id=entity_id',
                             '{{table}}.stock_id=1',
                             'left');
    $content = "Product Id,Product Name,Product Sku,Product Url,Product Image Url,Category Ids,Description,Product Qty,Special Price, Price\n";
    foreach ($products as $product){
        $content .= $product->getId() . ",";
        $content .= $product->getName() . ",";
        $content .= $product->getSku() . ",";
        $content .= $product->getProductUrl() . ",";
        $content .= (string)Mage::helper('catalog/image')->init($product, 'image') . ",";
        $content .= implode('|', $product->getCategoryIds()). ",";//change the category separator if needed
        $content .= strip_tags($product->getDescription()) . ",";
        $content .= (int)$product->getQty() . ",";
        $content .= (int)$product->getFinalPrice() . ",";
        $content .= (int)$product->getPrice() . ",";
        $content .= "\n";
        }

    }
    catch (Exception $e) {
        echo 'Error Message: '.$e->getMessage();
    }
      Mage::getSingleton('core/session')->addSuccess("Done");
     $this->_prepareDownloadResponse('export.csv', $content, 'text/csv');
   }

My problem is Description there som space  tag's is there due to that description take one one cell how i fix that


texts: How not to send pending transactional emails

texts:
Because the magento cron was not configured correctly, I have several and several transactional emails for order confirmation, delivery confirmation, new clients, among others pending to be sent and when I set up cron correctly all the same would be sent all at once. I'd like to know how I could get all of these transactional emails out of the box, or that the client does not receive the same and all new emails are sent correctly.

In the core_email_queue table, are all pending system emails to be sent, if I give a truncate to this table, is it likely to create a problem or end up influencing some dependency?

Thanks in advance.


texts: Magento 1.9.1.0 Universal Analytics - Send correct order currency to Analytics

texts:
We've updated to Universal Analytics in Magento 1.9.1.0, but we run multiple store views each with their own currency and all feeding into one Google Analytics profile.

Currently that means Analytics treats the values sent from Magento as all being in the default currency set in Google Analytics (GBP) - ie. an order in GBP may be say £200, but the same product in yen may be Y20000, but analytics thinks its an order for £20000.. which is needless to say is skewing our analytics data.

Looking through the Analytics help pages (https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#multicurrency) I can see there is a field available to specify to Google the currency you are sending the transaction as and then Google will handle the conversion which is grand.

The problem is I dont know how to edit Ga.php in Magento to get the currency code correctly set.  At line 176 in Ga.php I can see where ga('ecommerce:addTransaction) is put together but how do I get the correct currency code from Magento at this point?

I would have assumed this would be correctly set by default by Magento but apparently not.

Thanks


texts: Magento 2.2.2 - After update cart error has occurred :We can't find the quote item

texts:
After editing a product, i get this error,

  We can't find the quote item.

I cannot get new quote_id after editing a product.

Has anyone got any idea about this?


texts:
Do I want to know do we passe value from controller to my view?

I have my controller with the execute() function and I have a custom function in my controller (called getOrderInfos() with getting data from an XML).

getOrdersInfos() returns an array and I want this array to be displayed in my view. Do I need to use a block?

I'm new to Magento, and I'm stuck here...

Thanks

EDIT :

public function execute()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $customerSession = $objectManager->get('Magento\Customer\Model\Session');
    if(!$customerSession->isLoggedIn()) {
        $this->_redirect('/');
    }

    // echo "<pre>";
    // print_r($this->getCustomer());
    // echo "</pre>";

    $codeClient = $customerSession->getCustomer()->getCodeClient();
    $firstName  = $customerSession->getCustomer()->getFirstname();
    $lastname   = $customerSession->getCustomer()->getLastname();

    $fullName = strtolower($lastname.'_'.$firstName) ;
    $orderInfos = $this->getClientOrder($codeClient, $fullName);

    $resultPage = $this->_resultPageFactory->create();
    return $resultPage;
}

And (same file)

public function getClientOrder($code, $name)
{
    $objectManager = ObjectManager::getInstance();
    $directory = $objectManager->get('\Magento\Framework\Filesystem\DirectoryList');
    $base_path  =  $directory->getRoot();
    $fichier = 'fichier.xml';
    $xml = simplexml_load_file($fichier);
    $codeXML = $xml->name;
    return $codeXML;
}


texts: How to get order data from sales_order_shipment_save_after event

texts:
I am using sales_order_shipment_save_after event events for update update order status after shipment.

namespace Tenx\SalesExt\Observer;
use Magento\Framework\Event\ObserverInterface;

/**
 * Webkul Marketplace AdminhtmlCustomerSaveAfterObserver Observer.
 */
class SalesOrderShipmentSaveAfter implements ObserverInterface {

    public function execute(\Magento\Framework\Event\Observer $observer) {

        $shipment = $observer->getEvent()->getShipment();
        $order = $shipment->getOrder();
        $entity = $order->getId();
        $increment_id = $order->getIncrementId();
        if(!$order->getId()){
            return;
        }
           try {

            $data = array();
            $main = array();

            $payment_code = $order->getPayment()->getMethodInstance()->getCode();
            $payment_title = $order->getPayment()->getMethodInstance()->getTitle();

            if(isset($payment_code)){

                if($payment_code == 'cashondelivery'){

                    $this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
                                ->get('Magento\Framework\App\ResourceConnection');
                        $connection = $this->_resources->getConnection();

                        $tableName = $this->_resources->getTableName('sales_order');

                        $sql1 = "Update $tableName SET state = 'pending_payment', status = 'processing_shipped' where entity_id ='" . $entity . "' and increment_id='" . $increment_id . "'";

                        $connection->query($sql1);

                }
                else{
                    echo "payemt method not cod";
                }

            }

            }

}
}

I am getting order id and increment id but I am getting error unknown function getOrder(). Can anyone help me?


texts: Magento 2 REST API Update Single Customer Address

texts:
Does the Magento 2 REST API support updating a single customer address?

This endpoint is incomplete: customerAddressRepositoryV1

GET /V1/customers/addresses/{addressId}
DELETE /V1/addresses/{addressId}

This endpoint allows adding/updating of addresses: customerCustomerRepositoryV1:

PUT /V1/customers/{id}

To update an existing address specify the address id property (table customer_address_entity column entity_id). For example, to update address id = 16:

{
    "customer": {
        "email": "test@test.com",
        "firstname": "Test",
        "lastname": "Test",
        "store_id": 1,
        "website_id": 1,
        "addresses": [{
            "id": 16,
            "customerId": 1,
            "region": {
                "region_code": "CA",
                "region": "California"
            },
            "region_id": 12,
            "countryId": "US",
            "street": [
                "123 Test St."
            ],
            "telephone": "555 555 5555",
            "postcode": "90210",
            "city": "Beverly Hills",
            "defaultShipping": false,
            "defaultBilling": true
        }]
    }
}

However, if a customer has more than one address then all other addresses are deleted from the customer. We want to update the address (but NOT delete other addresses). It also seems redundant to have to pass customer information e.g. email. If this feature doesn't exist we'll need to create our own endpoint.