texts: Magento 2 get attribute options by attribute code?

texts:
How to get the list of option values for particular attribute code in magento 2?

<?php
namespace Sample\Shopbyage\Block;
use \Magento\Eav\Api\Data\AttributeOptionInterfaceFactory;

class Shopbyage extends \Magento\Catalog\Block\Product\AbstractProduct
{

    protected $_productCollectionFactory;
    protected $catalogProductVisibility;
    protected $urlHelper;
    protected $sqlBuilder;
    protected $imageHelperFactory;
    protected $eavEntityFactory;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility,
         \Magento\Framework\App\Http\Context $httpContext,
        \Magento\Rule\Model\Condition\Sql\Builder $sqlBuilder,
         \Magento\Widget\Helper\Conditions $conditionsHelper,
        \Magento\Catalog\Helper\ImageFactory $imageHelperFactory,
        \Magento\Framework\Url\Helper\Data $urlHelper,
        \Magento\Review\Model\ReviewFactory $reviewFactory,

        array $data = []
    ) {
        $this->_productCollectionFactory = $productCollectionFactory;
        $this->catalogProductVisibility = $catalogProductVisibility;
        $this->httpContext = $httpContext;
        $this->sqlBuilder = $sqlBuilder;
        $this->urlHelper = $urlHelper;
        $this->conditionsHelper = $conditionsHelper;

        parent::__construct($context, $data);

    }

    protected function _prepareLayout()
    {
    }

     public function toHtml()
    {
        return parent::toHtml();
    }

    public function getShopbyageUrl(){
       return $this->getUrl('shopbyage');
    }
    public function getProductCollection(){
        $ageValues = $this->getAge();
        $objectManager   = \Magento\Framework\App\ObjectManager::getInstance();
        $coll = $objectManager->create('Magento\Catalog\Api\ProductCustomOptionRepositoryInterfaceAttribute $attributeFactory');
        /*$coll->optionFactory->create();
        $coll->load($ageValues);
        $attrAll = $coll->load()->getItems();
        foreach($attrAll as $st=>$value){
            print_r($value);
        }*/
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addAttributeToFilter('age',array(5,6));
        return $collection;

    }

}

I have tried above code but not working.


texts: Magento 2 cms_index_noroute.xml not having any affect

texts:
I'm trying to gut the cms block from the 404 page. Which i successfully did for the homepage, by using the following home layout file.

 <referenceBlock name="cms_page" remove="true" />

However it doesnt matter what i do to cms_index_noroute.xml even if i change the core version it just does not seem to be using this file at all. Also when i switch of template hints and blocks this does not seem to actually be adding anything.

I'm ultimately trying to change this cms block into a template file block but for whatever reason it does not seem to be using this layout file. Any ideas?


texts: Magento 1.9.3.2 edit table /email/order/items.phtml - Solved

texts:
I can not change  <th> and color in email order

I changed the file /email/order/items.phtml but it does not work

If I add another <th>not work

Instead it works if I change the file in /email/order/items/default.phtml

Thanks


texts: How to make Magento supports new & used books, in a book store?

texts:
I want that each product (book), have two button "add new book to cart", "add used book to cart".

Do I need to develop something, or Magento do everything out-of-the-box?

If the answer is no, this what I have to do:

Add two buttons, that add the same product, but different prices.
Show in the list of product (category page), the two pricing.
Manage the inventory of each variant.

Do I need to use JavaScript, XML Theme, or what?

I don't need step-by-step answer, just a general idea. how to achieve those goals.

I'm a JavaScript developer, so some code will help me to appreciate.

Thank you.


texts: Transactional Emails: Where does $this->getValueProperties() get its values from?

texts:
I am trying to edit the totals portion of a transactional email. I have found the file it refers to:

/app/design/frontend/our_theme/default/template/sales/order/totals.phtml

which has this code:

<td <?php echo $this->getValueProperties()?>>
  <?php if ($_total->getStrong()):?>
    <?php echo $this->formatValue($_total) ?>
  <?php else:?>
    <?php echo $this->formatValue($_total) ?>
  <?php endif?>

The call to $this->getValueProperties() is inserting some inline CSS padding and a colspan to this table cell. I can't seem to figure out where it is getting these values from?

For example, the email output is as so:

  €PRICE


texts: Magento 2.3.4 Plugin Sitemap not working

texts:
I've had a plugin working on 2.2.2 version but it's not working on 2.3.4. Its seem that collectSitemapItems() method is not firing even in native magento WHen I print_r('Die');die;

public function collectSitemapItems()
    {
        print_r('Not firing');die;
        /** @var $helper \Magento\Sitemap\Helper\Data */
    ...

But it's printing under protected method _initSitemapItems()

/**
     * Initialize sitemap
     *
     * @return void
     */
    protected function _initSitemapItems()
    {
     print_r('Working Here');die;
    ...

My plugin have afterCollectSitemapItems() Method:

public function afterCollectSitemapItems(
        Sitemap $subject
    )
    {
        print_r('Not firing here either');die;

My Plugin di.xml:

 <type  name="Magento\Sitemap\Model\Sitemap">
   <plugin name="vendor-sitemap" sortOrder="1"  disabled="false" type="Vendor\Module\Plugin\Sitemap\Plugin"/>
 </type>

Any ideas why this isn't working anymore?


texts: how to fix A technical problem with the server created an error. Try again to continue what you were doing?

texts:
A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

in magento 2 admin

in orders :

in products:

when go to every page this error showing

how i can fix this???


texts: Magento Too many tables error bulk updating products

texts:
This morning while selecting and enabling some one hundred products in magento i got this mysql too many table error

Below is the snippet from the log file

a:5:{i:0;s:92:"SQLSTATE[HY000]: General error: 1116 Too many tables;
MySQL can only use 61 tables in a join";i:1;s:5786:"
#0 /var/www/html/dev.mysite.com/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
Zend_Db_Statement_Pdo->_execute(Array)

Gone through this mysql thread, http://forums.mysql.com/read.php?10,94448,94505#msg-94505
which says the eav db model is flawed..

It also says, if i do increase the 61 table limit also, the eav model will eventually exceed this.

I'm afraid Is magento eav model not flawless? or is it because i'm having too many custom attributes ? (150+ custom attributes and sets )

I'm pointless how to deal with this.

Looking for some help
Thanks


texts: Only `inventory_cleanup_reservations` CRON is not scheduled

texts:
The Magento2.3 instance is installed in AWS server. The CRON has setup correctly and there are many CRON's running successfully. Below is the content of cron_schedule.

But the issue is CRON with job_code inventory_cleanup_reservations. This CRON has never been scheduled since the installation. Which is causing an issue in stock management in case of the abandoned order. The inverntory_reservations tables is never been cleaned.


texts: Show out of stock configurable products without simple products (Magento 1.9)

texts: There are configurable products (without associated simple products) that are not displayed on frontend. Show out of stock products is set to YES. To get them displayed we have to create a simple product. This option we are trying to avoid. Unfortunately, we don't remember how we made it work 2 years ago (Magento 1.6)


texts: Load Block after another block but generate before

texts:
So I have a really interesting question.

I have a block that depends on Magento\Catalog\Block\Product\ListProduct.

Basically I need to load this block after the collection is generated.

I'm using getLoadedProductCollection method to load the collection.

In my layout this block is in the header, so when I call this method in header, I expect the collection to load, but instead it returns an empty  collection.

When I call it after the \Magento\Catalog\Block\Product\ListProduct is loaded, then I get the expected collection.

But then this block is at the end of the page.

I could move this block by using jQuery, but I'm trying to avoid such a workaround.

What's is the best way to generate this block in header and have the collection loaded in Magento\Catalog\Block\Product\ListProduct.

Thanks!


texts: Can you apply a category rule programmatically?

texts:
I've been using $product->getSpecialPrice() to build a custom price range on configurable products:

Hat
$3.50-$10.00
special price $2.00-$8.00

This works fine on the product page (templates/catalog/view.phtml) as I'm updating it dynamically by pulling data from the json product object.

However, the getSpecialPrice() is not being picked up on the category pages:

Hat
$3.50-$10.00
special price $0.00-$0.00

as getSpecialPrice() is returning null.

Is there a method to extract the price with the applied catalog rule?

thx


texts: How .htacces settings file, to disallow robots.txt in magento?

texts:
How .htacces settings file, to disallow robots.txt in magento ?

I have used the following script

<Files ~ "\.(tpl|txt)$">
  Order deny,allow
  Deny from all
  SetEnvIfNoCase User-Agent "Googlebot" goodbot
  Allow from env=goodbot
</Files>

but I still visible robots.txt if typed domain.com/robots.txt on my browser

I'am Use OS Server Debian and
Web Server Nginx


texts: How to remove manufacturer list from Advanced Search?

texts:
I want to remove manufacturer list from advanced search section. Is there any section available in magento backend end to disable or any way other way to disable it. Can anyone tell how to disable it ?
Sample URL: http://localhost.lst/index.php/catalogsearch/advanced/


texts: Magento Multistore and ZenCart configuration?

texts:
I have a unique situation that I haven't been able to find the answer to.

I have a Magento 1.9x install with a store on it.  Let's call it store1.com.  I have a second store installed using ZenCart and that is store2.com.  I want to create a NEW store using Magento Multistore option.  I've gone through all the correct steps and I know it's right.

My question is: how do I preview my new multistore BEFORE I update the DNS for ZenCart store2.com to point to Magento so that I can start working on the design?

Store2.com is currently live on ZenCart and I am not ready to update the URL.


texts:
Here i like to add the breadcrumbs in all pages for my magento application, for that i start to add breadcrumbs in account page first, i get idea from the below tutorial regarding how to add the breadcrumbs, but unfortunately even i did as per the tutorial still there is no breadcrumbs.

Tutorial : http://www.douglasradburn.co.uk/adding-breadcrumbs-to-customer-account-pages-in-magento/

MY local.xml file is placed in (app/design/frontend/lawyer/english/layout/federallawyer), hope you will get idea about my design folder structure.

Your idea and suggestion will help me more to solve this problem.

local.xml

**

    <?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>

        <reference name="breadcrumbs">
            <action method="addCrumb">
                <crumbname>Home</crumbname>
                <crumbinfo>
                    Home
                    <title>Home</title>
                    <link />/
                </crumbinfo>
            </action>
            <action method="addCrumb">
                <crumbname>My Account</crumbname>
                <crumbinfo>
                    My Account
                    <title>My Account</title>
                    <link />/customer/account/
                </crumbinfo>
            </action>
        </reference>

        <remove name="right.poll"/>
        <remove name="right.permanent.callout"/>
        <remove name="left.permanent.callout"/>
        <remove name="paypal.partner.right.logo"/>

        <reference name="head">
            <action method="removeItem"><type>skin_css</type><name>css/styles.css</name></action>
            <action method="addItem"><type>skin_css</type><name>css/styles.css</name></action>
            <action method="addItem"><type>skin_css</type><name>css/custom.css</name></action>
            <action method="addCss"></action>
            <action method="addCss"></action>
            <action method="addItem"><type>skin_js</type><name>js/fl.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/jquery.jcarousel.min.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/jquery.bpopup.min.js</name></action>
            <action method="addItem"><type>js</type><name>jquery/tinymce/tinymce.min.js</name><params/></action>
            <action method="addItem"><type>js</type><name>jquery/nanobar/nanobar.js</name><params/></action>
        </reference>
    </default>

</layout>


texts:
I tried running

sudo php bin/magento deploy:mode:show

but I am getting the following error

PHP Warning:  Use of undefined constant _DIR_ - assumed '_DIR_' (this will throw an Error in a future version of PHP) in /var/www/html/magento2/app/code/CustomModule/HelloWorld/registration.php on line 6

There are no commands defined in the deploy:mode namespace.

Please help I am new to Magento


texts: Getting error when Add 'Product Tier Prices' for Configurable products: Magento 2.3.2

texts:
I am using Magento 2.3.2. When i am tring to add Customer Group Price for child product of configurable products in admin panel then i am getting below error when save the product:

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '16092-1-0-30.0000-0' for key 'UNQ_6D3040166530765494A77D7288801D79', query was: INSERT INTO catalog_product_entity_tier_price (entity_id, all_groups, customer_group_id, qty, website_id, percentage_value) VALUES (?, ?, ?, ?, ?, ?)

but it's working for Simple Products as expected.

I am not able to understand why i am getting this error.

Once i have truncated that table but still getting Integrity constraint violation: 1062 Duplicate entry

Any help??


texts:
I have created an Observer in order to create and email shipment when an invoice is created.

I am using the sales_order_invoice_register event to create the shipment but for some reason I cannot get the email to send...

Here is my code:

public function salesOrderInvoiceShipmentCreate($observer)
{
    $shipmentCarrierTitle = $shipmentCarrierCode;
    $customerEmailComments = '';
    $order = $observer->getEvent()->getOrder();

    if (!$order->getId()) {
        Mage::throwException("Order does not exist, for the Shipment process to complete");
    }
    try {
        $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment(_getItemQtys($order));

        $arrTracking = array(
            'carrier_code' => isset($shipmentCarrierCode) ? $shipmentCarrierCode : $order->getShippingCarrier()->getCarrierCode(),
            'title' => isset($shipmentCarrierTitle) ? $shipmentCarrierTitle : $order->getShippingCarrier()->getConfigData('title'),
            'number' => $shipmentTrackingNumber,
        );
        $track = Mage::getModel('sales/order_shipment_track')->addData($arrTracking);
        $shipment->addTrack($track);
        $shipment->register();

        $shipment->save();
        $track->save();
        $email=true;
        $shipment->sendEmail($email,’’);
        _saveShipment($shipment, $order, $customerEmailComments);
    }catch (Exception $e) {
        throw $e;
    }
    return $save;
}
function _getItemQtys(Mage_Sales_Model_Order $order){
    $qty = array();
    foreach ($order->getAllItems() as $_eachItem) {
        if ($_eachItem->getParentItemId()) {
            $qty[$_eachItem->getParentItemId()] = $_eachItem->getQtyOrdered();
        } else {
            $qty[$_eachItem->getId()] = $_eachItem->getQtyOrdered();
        }
    }
    return $qty;
}

protected function _saveShipment(Mage_Sales_Model_Order_Shipment $shipment, Mage_Sales_Model_Order $order, $customerEmailComments = '')
{
    $shipment->getOrder()->setIsInProcess(true);
    Mage::log($shipment->debug(),Zend_Log::INFO,'shipment.log',true);
    $transactionSave = Mage::getModel('core/resource_transaction')
        ->addObject($shipment)
        ->addObject($order)
        ->save();

    $emailSentStatus = $shipment->getData('email_sent');
    if($emailSentStatus)
        Mage::log("Email has been sent",Zend_Log::INFO,'email.log',true);
    else
        Mage::log("IS FALSE",Zend_Log::INFO,'email.log',true);
    if (!is_null($shipment->getOrder()->getCustomerEmail()) && !$emailSentStatus) {
        $shipment->setEmailSent(true);
        $shipment->sendEmail(true, $customerEmailComments);
    }

    return $this;
}

protected function _saveOrder(Mage_Sales_Model_Order $order)
{
    $order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
    $order->setData('status', Mage_Sales_Model_Order::STATE_COMPLETE);
    $order->save();
    return $this;
}

The Shipment is created fine but the shipment email is not sent can anyone help?


texts: How to add additional condition while checking whether the guest allowed to checkout or not ( isAllowedGuestCheckout()) in magento 2

texts: I have created custom module to check additional condition while checking isAllowedGuestCheckout().Please provide me a solution


texts: Magento 2 : Add custom script just after body tag

texts:
I am using Magento 2.3

Can anyone please provide appropriate way for

How can i add my custom script code after the  tag.

Thanks


texts:
I have installed Magento and used a custom theme. I want to use a Best sellers widget on my homepage, but it doesn't work with Flat Catalog I have enabled on categories and products. As I understand the "standard" best sellers widgets don't work with FC enabled.

I must use Flat Catalog because the website has many categories and more than 1000 products.

I haven't found a way to make it work, some old articles from the web and no modules at all. I can't believe that there is no way to offer best sellers and/or most viewed products in larger shops that use FC, so, can someone please point me to the right direction here?


texts: Out of stock mail subscription Not working

texts:
I am using this extensions,

https://www.magentocommerce.com/magento-connect/product-out-of-stock-subscription.html

After instalation click mail id, right after click subscribe, no action taken.

I am getting error :

Console Error : http://i.imgur.com/mEFeXaI.png

Networkik Error : http://i.imgur.com/NayEraO.png

Log Error :

a:5:{i:0;s:39:"This product is currently out of stock.";i:1;s:1205:"#0 /home/xyz/public_html/app/code/core/Mage/Checkout/Model/Cart.php(284): Mage::throwException('This product is...')
#1 /home/xyz/public_html/app/code/local/Cmsmart/AjaxCart/controllers/IndexController.php(310): Mage_Checkout_Model_Cart->addProduct('31543', Array)
#2 /home/xyz/public_html/app/code/local/Cmsmart/AjaxCart/controllers/IndexController.php(133): Cmsmart_AjaxCart_IndexController->tryaddAction(Object(Mage_Catalog_Model_Product), Array)
#3 /home/xyz/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Cmsmart_AjaxCart_IndexController->indexAction()
#4 /home/xyz/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#5 /home/xyz/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#6 /home/xyz/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#7 /home/xyz/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#8 /home/xyz/public_html/index.php(88): Mage::run('', 'store')
#9 {main}";s:3:"url";s:111:"/ajaxcart/index/index/?product=31543&related_product=&subscription_email=xyz%40gmail.com&_=1478327890211";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"english";}


texts: Minicart blank only on product page magento 2 getting knockout js error!

texts:
I am using an extension WeltPixel_QuickCart for minicart sidebar. It is working fine on all pages except product detail page.

Knockout js error showing in the console on product page:

Uncaught ReferenceError: Unable to process binding "template: function(){return getTemplate() }"
Message: getTemplate is not defined
    at template (eval at createBindingsStringEvaluator (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:2624), <anonymous>:3:61)
    at init (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:5023)
    at pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:2989
    at Object.ignore (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:1249)
    at pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:2988
    at Object.arrayForEach (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:151)
    at applyBindingsToNodeInternal (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:2974)
    at applyBindingsToNodeAndDescendantsInternal (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:2854)
    at applyBindingsToDescendantsInternal (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:2836)
    at Object.ko.applyBindingsToDescendants (pub/static/frontend/Smartwave/porto_child/en_GB/knockoutjs/knockout.js:3052)

How can I fixed the issue?


texts: Attachement Upload (Uncaught SyntaxError: Unexpected token < in JSON at position 0)

texts:
If I want to insert a file, into the product, I get the following error message in the console.
Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at String.parseJSON [as evalJSON] (prototype.js:720)
    at klass.onFileSuccess (instance.js:359)
    at d.<anonymous> (prototype.js:391)
    at d.<anonymous> (flow.min.js:2)
    at k (flow.min.js:2)
    at d.fire (flow.min.js:2)
    at e.chunkEvent (flow.min.js:2)
    at f.event (flow.min.js:2)
    at XMLHttpRequest.doneHandler (flow.min.js:2)

I use the Aitdownloadablefiles extension for attachments, but I don't think that's because it is the same with other extensions that do the same thing.
Magento Version 1.9.4.5, PHP 7.2


texts: Add custom product attributes to catalog_product_entity_decimal table?

texts:
Is there any reason why it impossible to add custom attributes to catalog_product_entity_decimal table?

I tried to look up products by weight, length, height, width and started with weigth. Thats a system attribute and is stored in catalog_product_entity_decimal table while custom attributes are stored in catalog_product_entity_varchar ...

When adding attributes from backend the only type is price that maps to decimal table, but it also set price backend model.

Any reason why there is no option to add a decimal attribute?

Update:

Of course I can change backend type on DB or add the attribute via script, but I'm interessted why its not possible to do it from admin backend.


texts: Check if customer attribute already exists

texts:
I have a custom module which is called on the customer_save_observer_executed event and specifically when a customer updates their details in their account page (name, password, email etc) I have added a custom attribute called display_name.

When a customer submits this form i need to check if the display_name currently exists for any other customer. If it doesn't then setDisplayName(...) else do nothing/display error message.

I was hoping to do this with this snippet:

$customer_check = Mage::getModel('customer/customer')
->getCollection()
->addAttributeToSelect('display_name')
->addAttributeToFilter('display_name',$new_name)->load();

if ( is_object($customer_check) && count($customer_check) >= 2) {
    // dont allow - duplicate customer displayname
}
else {
    // allow update....
}

My current code in Model -> Observer.php

class xxxxxxx_Model_Observer
{
    public function xxxxxxxx(Varien_Event_Observer $observer)
    {
        // to stop event being fired twice
        if(Mage::registry('customer_save_observer_executed')){
            return $this;
        }

        $postData = Mage::app()->getRequest()->getPost();
        $customer = $observer->getCustomer();

        // if updating NOT a new customer
        if($customer instanceof Mage_Customer_Model_Customer && !$customer->isObjectNew()) {

            // check display name is posted
            if(!empty($postData['display_name'])){

                $current_name = $customer->getDisplayName();
                $new_name = $postData['display_name'];

                // duplicate check
                $customer_check = Mage::getModel('customer/customer')
                ->getCollection()
                ->addAttributeToSelect('display_name')
                ->addAttributeToFilter('display_name',$new_name)->load();

                if ( is_object($customer_check) && count($customer_check) >= 2) {
                    // dont allow - duplicate customer displayname
                }
                else {

                    if( $postData['display_name'] !== $current_name ) {
                        $customer->setDisplayName($postData['display_name']);
                    }

                }

            }

        }

        Mage::register('customer_save_observer_executed',true);

    }
}

but this just updates the display_name even if i deliberately set it to a duplicate of another customers

UPDATE

Looking into this further it looks like the module function itself is not being run or nothing inside it is taking affect, as whatever i put in it doesn't work. It is infact the default behaviour that is setting the displayname not my module. My module is activated and my config file uses the customer_save_commit_after event as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <xxx_xxxxx>
            <version>0.0.1</version>
        </xxx_xxxxx>
    </modules>
    <global>
        <models>
            <xxx_xxxxx>
                <class>xxx_xxxxx_Model</class>
            </xxx_xxxxx>
        </models>
        <events>
            <customer_save_commit_after>
                <observers>
                    <xxx_xxxxx>
                        <class>xxx_xxxxx/observer</class>
                        <method>xxxxxx</method>
                        <type>singleton</type>
                    </xxx_xxxxx>
                </observers>
            </customer_save_commit_after>
        </events>
    </global>
</config>


texts: Different domain for different magento store view

texts:
I have a Magento installation in m.theseolounge.co.uk with English (default) and German store views. When the user select the German site I want to have the German view to display the URL marsdenweighing.de. I have change the Base URL in Magento, added a parked domain on my host and pointed the domain to my host. IN addition to this I have added the code below in the .htaccess file above the Rewrite On:

SetEnvIf Host www\.m\.theseolounge\.co\.uk MAGE_RUN_CODE=default
SetEnvIf Host www\.m\.theseolounge\.co\.uk MAGE_RUN_TYPE=website
SetEnvIf Host ^m\.theseolounge\.co\.uk MAGE_RUN_CODE=default
SetEnvIf Host ^m\.theseolounge\.co\.uk MAGE_RUN_TYPE=website
SetEnvIf Host www\.marsdenweighing\.de MAGE_RUN_CODE=german
SetEnvIf Host www\.marsdenweighing\.de MAGE_RUN_TYPE=store
SetEnvIf Host ^marsdenweighing\.de MAGE_RUN_CODE=german
SetEnvIf Host ^marsdenweighing\.de MAGE_RUN_TYPE=store

Still no luck If I select from http://m.theseolounge.co.uk the German store, I get redirected to http://marsdenweighing.de/german/?SID=34djak9idkc7jq98c63g2mg5b6&___from_store=default

Why is the /german/ appended to the URL and why "SID=34djak....?
Any pointer?


texts: How to sort super product attributes configuration in Magento?

texts: I created a configurable product and added associated products to it but the order of the super product attributes configuration is not sequential. It's shown in the below image. How do i sort them in order?. Current order is Option: 6,8,9,10,7 --How do i get it to Option: 6,7,8,9,10 order. can anyone please help me on this. Thanks


texts: Unable to log into a customer account created via the Rest API

texts:
I create customer through rest api.

But I am not able to login that customer.

But customer registered on site can login to magento site.

Can you help me to solve this.


texts:
I have a static block defined in magento's backend

This is how i call it in one of the templates

$this->getLayout()->createBlock('cms/block')->setBlockId('header_links')->toHtml()

The output (it is not rendering the {{}} parts..


texts: Product edit page problem in magento admin panel

texts: I am facing some weird problem , As I logged in to admin panel of magento everything works fine, except the product edit page. When I clicked on product to edit the details, it's load improperly for ref. please check image. I didn't get why this happening


texts: changing logo position in responsive theme

texts:
I'm using the ultimo theme, and have some issues with header logo position.

My logo is a square box, with some graphics 'sticking out' on the left. Let's say it looks like this:

http://goodlogo.com/images/logos/calvin_klein_logo_2623.gif

The K is the edge of the box, and the C is ‘sticking out’.

In the default layout, this alignment looks no so good – the logo is too far right. What I need is for the edge of the box (K), to be aligned with the left border of the page body/menu nav.

If I force the CSS like this:

  .header .logo-wrapper {       position: relative;
      left: -15px; }

It kind of works, moving the logo a little to the left and the alignment looks as I’d hope.

But the responsiveness breaks. I need to somehow adjust the css  when the small sizes kick in.

How can I do that? What is the best way to move the logo left?

(I know this might be theme specific - but not sure, so asking anyhow. I have a feeling this is more about responsive-theme handling in general)

update: here's a graphic to show what I mean:


texts: What is the use and benefit of static content signing in Magento 2 ? Is it recommended to disable it from backend ?


texts: Change order of JavaScript files in head

texts:
I add a custom JavaScript file with the following code:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="VendorNamespace_Module::someJs.js"/>
    </head>
</page>

My problem is that this js file requires jQuery, but it is loaded before the jQuery JavaScript file (when I look at the head section of my html, jQuery.js comes after someJs.js). How can I change this order so that my file is loaded afterwards?


texts: how can i change Admin custom menu icon in magento 2?

texts: I have a png image and I want to replace the default icon of the custom menu in the admin panel in Magento. I tried to other articles who are customizing their code in the app/code/Vendor/Module/ folder but that was not working for me so please suggest any simple solution.


texts: Redirects using routes.yaml in the root folder .magento/routes.yaml

texts:
Can anybody for the love of god help me with the syntax here. I feel like i've tried everything and everytime i try to push this to the magento cloud it complains about something or another.
Here's my latest iteration:
# The routes of the project.
#
# Each route describes how an incoming URL is going to be processed.

"http://{default}/":
    type: upstream
    upstream: "mymagento:php"
    paths: "^/catalogsearch/result((/)|(/\\?)|(/\\?[a-z])|(/\\?[a-z]=))?$"
    to: "https://www.example.com", regexp: true

Error message when deploying to cloud is this:
E: Error parsing configuration files:
    - routes: Error loading file: while parsing a block mapping
          in ".magento/routes.yaml", line 8, column 5
        did not find expected key
          in ".magento/routes.yaml", line 11, column 39


texts:
it is possible to add an if or depend
by type of payment method in transactional emails?

So change the text?


texts: Index Management page showing blank in admin panel

texts: I am having this issue, Index page is showing blank page. I recently updated my website from Magento 1.6 to Magento 1.9.3.3.


texts: My staging takes longtime and displays connection timed out, but live site works on same IP

texts:
enter image description here

Please help,
Firstly I got the attached error on the site and now since yesterday my staging site is not working.

Live site is hosted on digital ocean, Ubuntu and the only change made yesterday on live site is that I created a sudo user for root, enabled firewall and change upload_max_limit to 8MB for image file upload in apache2 > PHP.ini file.

The staging site was anyway not working prior than that but was giving error, But now it just keeps searching and returns with time out.

Need help please to resolve it. Any test file is also not working.


texts: Using magento's contact form create a contact form with 4 fields with the use of Javascript or others to create more

texts:
I'm working on a contact form within magento to work as an artwork upload after ordering so you can send the artwork for the banners. It'll have the follow fields

Item SKU, Image Name, Upload

It would be these 3 that been to be repeated when the user clicks a button to add more.

I've setup a template within magento and made changes to the contact form to get additional fields working but 2 of the same type also seem to create issues.

Here an example of what I'm trying to achieve


texts:
I need a extension or script that exports product to csv file as following. I know there is no code or anything but could you please help me find a solution for this. thanks

Our Feed Requirement            Field we could use from your feed

Product ID                                 column A  -  sku

Product Name                          column B  -  product_name

Product Price                            column C  -  product_price

Product URL                              column F  -  product_url

Product Description                 column D  -  product_description

Product Image URL                  column G -  image_url

Product Category                     column E  -  category_name


texts:
I'm using Trego theme on a brand new magento installation. This theme comes with a Blog extension for Magento that seems to not work. I'm pasting what the page throws to me when I click on the "Blog" link in the Home Page:

https://gist.github.com/anonymous/85967f18a3527096a513#file-blog_error

There has been an error processing your request
String could not be parsed as XML

Trace:
#0 /var/www/vhosts/pipioletta.com/httpdocs/app/design/frontend/default/trego/template/trego_blog/flickrphotos.phtml(11): SimpleXMLElement->__construct('')
#1 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#2 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#3 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#4 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#5 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#6 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#7 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#8 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('right', true)
#9 /var/www/vhosts/pipioletta.com/httpdocs/app/design/frontend/default/trego/template/page/2columns-right.phtml(26): Mage_Core_Block_Abstract->getChildHtml('right')
#10 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#11 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#12 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#13 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#14 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#15 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#16 /var/www/vhosts/pipioletta.com/httpdocs/app/code/community/Trego/Blog/controllers/IndexController.php(28): Mage_Core_Controller_Varien_Action->renderLayout()
#17 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Trego_Blog_IndexController->listAction()
#18 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('list')
#19 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#20 /var/www/vhosts/pipioletta.com/httpdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#21 /var/www/vhosts/pipioletta.com/httpdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#22 /var/www/vhosts/pipioletta.com/httpdocs/index.php(87): Mage::run('', 'store')

Well, assuming that this is my second week with magento I am a bit lost and I really don't know how to proceed to solve this error.

Cheers.


texts: I can not find the payment method in the dirty menu backoffice


texts: Magento2 - Add a phtml above footer on category pages

texts:
I want to have a phtml file load only on the category pages . So In a specific category in the design tab I put the below code in the design layout xml textarea.

<referenceContainer name="page.bottom.container">
<container name="categoryugc" htmlTag="div" htmlClass="ugc">
    <block class="category-ugc" name="bottom.ugc.div" template="category-ugc.phtml"/>
</container>

I then created the category-ugc.phtml file in

app/design/frontend/Smartwave/porto_child/Smartwave_Porto/templates/html/

I cleared cache and refreshed the page but it still doesnt show the needed phtml page?


texts: Magento 2 send data using ajax in custom form

texts:
How can i accomplish it?
Here is my controller:

    public function execute()
{
    $data = $this->getRequest()->getPostValue();
    $resultRedirect = $this->resultRedirectFactory->create();

    if ($data) {
        $model = $this->callbackInterfaceFactory->create();
        $model->setData($data);
        try {
            $this->callbackRepository->create()->save($model);
            /** massage on email */
            $massage = '';
            if ($this->scopeConfig->getValue('dukir_callback_configuration/email/enable', ScopeInterface::SCOPE_STORE) == '1') {
                $this->sendmail->sendmail($data);
                $massage = ', and sent to the mail';
            }

            $this->messageManager->addSuccessMessage(__('Successfully saved' . $massage));
            return $resultRedirect->setPath($this->storeManager->getStore()->getBaseUrl());
        } catch (\Exception $e) {
            $this->messageManager->addErrorMessage($e->getMessage());
            return $resultRedirect->setPath($this->storeManager->getStore()->getBaseUrl());
        }
    }
}


texts: Product .csv import stuck on "Please Wait"

texts: I'm not sure why but all of a sudden when I try to import my .csv file to update my products it gets stuck on the "Please Wait" screen. It was working just fine one day then the next it's doing this. What do I do... Please help!


texts:
After successfully running composer install under the setup directory and then calling 127.0.0.1:8080/setup in my browser, the Magento Installer runs and I am able to successfully complete the first five config steps without error, including locally verifying the mysql db params. Everything reports normally and without error.

Step 6, where you actually run the installer, not so much.

The installer quits/hangs at 0% Complete and reports that the installation is incomplete and to check the console log for the errors.

The console log is empty of any comment relating to magento, php, http issues.

Further, the buttons for previous and try again are both disabled. I can reload the setup and re-complete the setup process, but it hangs in the same spot each time. I am nothing if not persistent.

Curious if anyone else has experienced a crash at this step and if so, how you resolved it.

I confess I'm stumped by the lack of log data.


texts: Varien_Data_Form_Element_Color missing in magento 1.9.1

texts:
I see that Varien_Data_Form_Element_Color form input type is not found in Magento 1.9.1

Do you know why it was deprecated? Or has this been replaced by something else?


texts: Edit Page 'Custom Page' get content from other table

texts:
How can I get content in cms edit page from other table?

Which function should be overwritten?

I want to change the table where the content in wysiwyg editor is getting from another table.

How can i change this?

I mean on changing the SQl table, by default magento is reading content from (cms_page) but now I want to get from other table. Any help please


texts: Add Dynamic Variable To Transaction Email

texts:
I need a dynamic variable to be called in email header and footer based off of the name of the main email template.

I achieved this by adding my variable directly in the setTemplateParams()function which is called by the send() function in app/code/core/Mage/Core/Model/Email/Template/Mailer.php.

$template =
        Mage::getModel('adminhtml/email_template')
            ->load($this->getTemplateId());
       $templateName = $template->getTemplateCode();

    $templateParams['template_name'] = str_replace(' ', '_',$templateName);

This worked fine for my order confirmation email where I was able to call this variable with
{{var template_name}}
However when I tested a stock alert email I discovered that it does not call this send() function in app/code/core/Mage/Core/Model/Email/Template/Mailer.php instead it has it's own send() function in app/code/core/Mage/ProductAlert/Model/Email.php.

Is there any one spot where I would be able to add this variable to all email templates.(I need somewhere that i have access to the current templates Id to get the template name, or anywhere that I would have direct access to the template name).


texts: Keep old urls for default store view in magento after enabling store code in urls

texts:
I have enabled store codes for my Magento website and it is working fine. I have two store views, arabic and english. For arabic, i have store code ar and en for english. My default store view is arabic.

Now google has indexed my website and when store code in urls are enabled, then old urls for catalog are not working and it gives a 404 error page. It is very bad for my website SEO.

I want to have a way, that if a customer comes to old url (which doesnt have a store code), then the customer should be redirected to the equivalent url which has a default store code. For example, if a customer comes to

http://mywebsite.com/category/product.html

the customer should be redirected to

http://mywebsite.com/ar/category/product.html

so that the customer doesnt go to 404 page.

Strange thing is that the above criteria is working for cms pages, customer pages etc, and is not working only for catalog pages (category and products).

My website is on a debian 7 server with nginx and php5.5 fpm and magento version is 1.8.0.

Thanks for the guidance.


texts:
I am using Mega Menu free extension from Ibnab. I want to override menu file to add custom li.

app/code/Ibnab/MegaMenu/view/frontend/templates/html/top-mega.phtml

Is there any way to override this file in my custom theme ?

I added custom html in this file but nothing is showing on frontend.

Thanks.


texts: Order Id and order View link showing different order id

texts:
[enter link description here][1]In magento 2.3 multivendor marketplace When i am seeing my sales order from admin panel there i found order id which showing on Grid and order view link where order id showing is differ from grid's order id. This mismatching of ids create a lot of confusion when a customer orders the product from our platform . He/she getting order placement message according to View Link orderid.
you can see this video link for better understanding.
[1]: https://www.awesomescreenshot.com/video/3181610?key=f91c7fe7831ee2e97f0b2b91f8277d4f


texts: Magento page does not load because cookie conflict

texts:
I have exact this problem:

Maximum execution time exceeded. Clearing cookies only solution

Sometimes and with some users the page does not load, and shows random errors with

  "Fatal error: Maximum execution time of XXXXXXX seconds exceeded in
  ..."

I'm 90% sure that is something related with the cookie because in private mode loads normally and if I clean my cookies in my browser then loads.

I don't want to disable persistent shopping cart, I don't know if there's a configuration about cookies that I'm missing.

Session Cookie Management

Cookie Lifetime: 86400
Cookie Path:
Cookie Domain:
Use HTTP Only: Yes
Cookie Restriction Mode: No


texts: magento upgrade error 1075 incorrect table definition

texts:
when I execute "php bin/magento setup:upgrade"

I got this error:
 enter code hereCache cleared successfully
File system cleanup:

/var/www/magento-ci/generated/code/Amazon
/var/www/magento-ci/generated/code/Composer
/var/www/magento-ci/generated/code/DOMDocumentFactory.php
/var/www/magento-ci/generated/code/Dotdigitalgroup
/var/www/magento-ci/generated/code/Klarna
/var/www/magento-ci/generated/code/MSP
/var/www/magento-ci/generated/code/Magento
/var/www/magento-ci/generated/code/Symfony
/var/www/magento-ci/generated/code/Temando
/var/www/magento-ci/generated/code/Vertex
/var/www/magento-ci/generated/code/Yotpo
/var/www/magento-ci/generated/metadata/adminhtml.php
/var/www/magento-ci/generated/metadata/crontab.php
/var/www/magento-ci/generated/metadata/frontend.php
/var/www/magento-ci/generated/metadata/global.php
/var/www/magento-ci/generated/metadata/graphql.php
/var/www/magento-ci/generated/metadata/interception.php
/var/www/magento-ci/generated/metadata/webapi_rest.php
/var/www/magento-ci/generated/metadata/webapi_soap.php

Updating modules:
Schema creation/updates:

SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key, query was: ALTER TABLE cms_block MODIFY COLUMN block_id smallint(6)  NOT NULL  AUTO_INCREMENT COMMENT "Entity ID", DROP PRIMARY KEY, ADD CONSTRAINT  PRIMARY KEY (block_id)

Is there anybody know the reason?
thanks in advance


texts:
How to get image url in magento 2 on checkout page custom phtml file.
I created the custom phtml. I need to get the product image in that phtml file


texts: Navigation Drop Down - Icon Changes When Active

texts:
I have a drop-down navigation for my site - think Prada.com; users click on a little icon at the top and the entire navigation is revealed. This works perfectly, however I can't quite get the icon to work well.

Currently, when users click the icon changes from a 'menu' icon to a 'X' icon. Which is perfect, however when users start clicking somewhere within the navigation (either on a category or into empty space) the 'X' icon changes back to the menu icon. The 'X' icon should be present the entire time that the navigation is open, then once it's closed change back to a menu icon. Hopefully that makes sense. Prada is a perfect example of how it's done, seamlessly.

Here is my HTML code:

Here is my CSS:

.skip-link .icon {
display: inline-block;
width: 30px;
height: 30px;
vertical-align: middle;
}

.skip-nav .icon, {
background-image: url("../images/icon_sprite.png");
background-repeat: no-repeat;
text-indent: -9999px;
float: right;
margin-top: 8px;
}

.skip-nav {
float: right;
}

.skip-nav:not(.skip-active):hover {
text-decoration: none;
}

.skip-nav:not(.skip-active):hover .icon {
background-position: -46px 4px;
}

.skip-nav .label {
display: inline;
}

.skip-nav .icon {
}

.skip-nav:focus .icon {
background-image: url(../images/icon_sprite3.png);
}

Any help is appreciated! Thanks!


texts:
Whenever an order is placed, stock is being deducted as it should. However when the order is cancelled the stock isn't being returned to the total available qty. This happens for both simple products and configurable products.

The options I have Catalog -> Inventory ->
Set Items' Status to be In Stock When Order is Cancelled -> Yes but it has no affect when an order is cancelled if it's out of stock it still stays out of stock.

Is this something that the cron job is meant to take care of?


texts: Magento 2 Products Not Showing on Website

texts: So let me be as specific as possible about all the attempts. I am aware of how to successfully upload CSV into the backend. Prior to this product load I am referencing, there were 8 configurable pants on our website. I went to upload 2 more configurables to the backend. The CSV loaded successfully. I made sure that the configurables are set to catalog/search, reindexed, cached, and all else. When the category pants is clicked on within the top menu, it goes to the pants page. There is a menu item on the left hand side that shows, numerically, there are 10 types of pants to select from, but I cannot see these two new pants on the website anywhere. Their URLS work if copied from the backed into the browser, but other than that, they cannot be found.


texts: I would like to recreate the boxes with text in them (you can see them on the picture below) I have access to the html part but when i paste it on a new page, they appear as bullet instead of boxes:


texts: Magento2 display Guest Customer Order Under his My Account > My Orders after Guest Created an account

texts:
A customer placed order #000030382. He then created an account separately, via the top nav Account Creation icon, with the same email address as the order email address. I can see his account record in Customers in admin, but it's not connected to his order (as this is currently marked as Guest checkout). Are we able to connect these so he can see his order and tracking info?
Can someone guide me how can I achieve this?


texts:
I'm following the tutorial link below (first method), but I am not succeeding:

http://www.magentocommerce.com/wiki/5_-_modules_and_development/admin/how_to_customize_backend_template_f.e._sales_order_information

I start creating my module on app/etc/modules/Fouron_Sales.xml:

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Fouron_Sales>
            <active>true</active>
            <codePool>local</codePool>
        </Fouron_Sales>
    </modules>
    <default>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_view_info>Mage_Fouron_Sales_Block_Sales_Order_View_Info</sales_order_view_info>
                </rewrite>
            </adminhtml>
        </blocks>
    </default>
</config>

After I created at app/code/local/Fouron/Sales/Block/Sales/Order/View/Info.php:

<?php

class Mage_Fouron_Sales_Block_Sales_Order_View_Info extends Mage_Adminhtml_Block_Sales_Order_View_Info
{
    protected function _construct()
    {
        $this->setTemplate('fouron/sales/order/view/info.phtml');
    }
}

And finally the file app/design/adminhtml/default/default/fouron/sales/order/view/info.phtml

I spend hours with this and tried some other modifications unsuccessfully, any help will be great. Thanks.


texts:
I am facing a problem with my new website. I have set up a slider at the frontend but it does not load any image i put in. What is blocking the slider? I have been installing a theme over a old theme as i cannot import configurable products etc and this is way faster.

What can block it and how can i find out?

This is the errors i get in the Console:

Any idea?


texts: Magento 2.3: system.xml and config.xml: Default values not showing up in the admin

texts:
I'm developing a module for Magento 2.3 and can't get default config values to show up in the admin. To the best of my knowledge, I've followed all the documentation I can find. It's kind of driving me crazy :)

A link to my full project can be found here: https://github.com/crankycyclops/DiscountCodeUrl

And here are the contents of the two relevant files:

etc/adminhtml/system.xml:

<?xml version="1.0" ?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">

    <system>

            <group id="discounturl" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">

                Discount URL Settings

                <field id="enabled" translate="label comment" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                    Enabled
                    <comment>If the discount URL module is enabled, you'll be able to apply discount codes automatically via URL. Disable this if you have other modules running that implement similar behavior or that might conflict.</comment>
                    <validate>required-entry</validate>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>

                <field id="url_param" translate="label comment" type="text" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                    URL Parameter
                    <comment>This is the GET parameter that will contain a coupon code in the URL. For example, if this value is "coupon", then https://store.url?coupon=CODE will set the coupon code to "CODE." If this value isn't set, we'll use the hardcoded default specified by Helper\Cookie::DEFAULT_URL_PARAMETER.</comment>
                </field>

                <field id="cookie_lifetime" translate="label comment" type="text" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                    Cookie Lifetime
                    <comment>When a coupon code comes in through a URL, we set it in a cookie so that we can remember it for the entire session. This value determines how long that cookie should stay set before it expires (in seconds.) Value must be 0 or greater (0 means the cookie will remain alive until the browser window or tab remains open.) If this value isn't set, we'll use the hardcoded default specified by Helper\Cookie::COOKIE_LIFETIME.</comment>
                    <validate>validate-zero-or-greater</validate>
                </field>

            </group>

    </system>

</config>

etc/config.xml:

<?xml version="1.0" ?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">

    <default>

        <promo>

            <discounturl>

                <enabled>0</enabled>
                <url_param>coupon</url_param>
                <cookie_lifetime>0</cookie_lifetime>

            </discounturl>

        </promo>

    </default>

</config>


texts: How to set original price when order is placed programmatically in Magento 1.9?

texts:
I have the same issue mentioned in Original Price is not sets in programmatically order, since it is not answered i am posting it again.

When i am placing order programmatically original price is not getting set in sales_flat_order_item table.

The following is the code snippet for place order which  have used

                $quotePayment = $quote->getPayment();
                $convertQuote = Mage::getSingleton('sales/convert_quote');
                $order        = $convertQuote->addressToOrder($quote->getShippingAddress());
                $orderPayment = $convertQuote->paymentToOrderPayment($quotePayment);

                $order->setBillingAddress($convertQuote->addressToOrderAddress($quote->getBillingAddress()));
                $order->setShippingAddress($convertQuote->addressToOrderAddress($quote->getShippingAddress()));

                $order->setPayment($convertQuote->paymentToOrderPayment($quote->getPayment()));

                foreach ($quote->getAllItems() as $quoteItem) {
                    $orderItem = $convertQuote->itemToOrderItem($quoteItem);
                    if ($quoteItem->getParentItem()) {
                        $orderItem->setParentItem(
                            $order->getItemByQuoteItemId($quoteItem->getParentItem()->getId())
                        );
                    }
                    $order->addItem($orderItem);
                    echo json_encode($orderItem->getData());exit;
                }

                $order->place();
                $order->save();

                //$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING,true)->save();

                        Mage::dispatchEvent(
                        'checkout_submit_all_after',
                        array('order' => $order, 'quote' => $quote)
                    );

                        Mage::dispatchEvent(
                        'checkout_onepage_controller_success_action',
                        array('order' => $order, 'quote' => $quote)
                    );

Any help to solve this issue will be appreciated.


texts: Magento 2 - Why is product image size & dimensions changed after upload?

texts:
When uploading new images to a product in Magento 2, it is not only decreasing the dimensions of the image, but it's increasing the image file size:

Image Details Before Upload

Dimensions: 1185 × 1580 px
File Size: 446 KB

After Upload

Can anybody explain why this is happening? I accept that some data may be added to the image by Magento, but I don't understand why it has been resized? Is there anywhere this can be changed?

EDIT

I've now discovered that the image dimensions have been set in vendor/magento/framework/File/Uploader.php

Next is to find the best way to change these values, I found this related post: Magento 2 change max image height and width of image uploader in Admin?

I still don't know why these dimensions have been imposed on users on M2. nor why the file size more than doubles in size!


texts: How to Fetch results from server using JQuery AJAX? on the basis of Drop-down Condition

texts:
I have two conditions, if two conditions are matching the given value should  display. I am using input value as Drop down. If the value of two drop-downs matched i need to display my value on same page.
For Example:
dropDown1 selection -> KM : 10(Dropdown),
dropDown1 selection -> Fueal : 2 Lit(Dropdown)

Output: Happy Jorney
On the same page and below the drop-down List.


texts: How to add column using extension_attributes.xml in magento2?

texts: How to add column using extension_attributes.xml in magento2 ?


texts: Magento 2 : Creating JS Mixins for anonymous functions?

texts:
I would like turn all my js overwrites into mixins. I'm trying to create a mixin for the following file:

view/frontend/web/js/action/place-order.js

But the function in there doesn't have a name

'    return function (paymentData, messageContainer) {'

When googling and checking magento 2 docs I can't find anything about how to turn a function without a name into a mixin. Anyone have an idea?


texts: Can't make downloadable product to be in stock

texts:
I cant make product be available(in stock) to add them to cart,

I change settings in product manage(make it "in stock" and add Qty)
I also choose no in system > conf > catalog > inventory > Manage Stock
I refresh index management
I use default layout
I didn't change anything in code

Products are still shown as out of stock and I cant add any to cart, how can I solve that because I have no idea now.


texts: Homepage intermediately not working Magento 2

texts:
Similar to  this question  sometimes my homepage shows the 404 page not the homepage. I know that in the admin side it's linked correctly, because most of the time the homepage shows up. All the caches are enabled on the magento side, and I also use cloudflare. I am also using the pearl theme.

Edits based on comments:

What the homepage looks like when this error happens:

Browser console log:

Server error log:

from the 22nd : client denied by server configuration

Magento debug log:

from the 19th : main.DEBUG: cache_invalidate

So it is some kind of caching issue, but I have no idea what is causing it.


texts: How to hide Empty Categories in Magento2

texts:
I'm in the final stages of setting up my magento 2 store. In the backend I have a process using the API to keep stock information up to date. Sometimes the stock drops to 0 for every item in a category, making it empty. If you go to one of those categories you get:

We can't find products matching the selection.

This makes sense, but I was wondering if there was a may to have magento hide the category altogether if the products in the category have no stock.


texts: Magento CMS, stop removing new lines for easier reading

texts:
How do I overcome the Magento CMS editor reformatting my html (removing new lines)

I write down this

And after I save it looks like this


texts: Magento 2.2 2: bin/magento commands not working

texts:
I'm getting this error:

    Uncaught Error: Class 'DOMDocument' not found in /home/hgfvhx/public_html/vendor/magento/framework/Config/Dom.php:384
Stack trace:
#0 /home/hgfvhx/public_html/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<?xml version="...')
#1 /home/hgfvhx/public_html/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): Magento\Framework\Config\Dom->__construct('<?xml version="...', Object(Magento\Framework\App\Arguments\ValidationState), Array, 'xsi:type', NULL)
#2 /home/hgfvhx/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(149): Magento\Framework\ObjectManager\Config\Reader\Dom->_createConfigMerger('Magento\\Framewo...', '<?xml version="...')
#3 /home/hgfvhx/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(130): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#4 /home/hgfvhx/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(275): Magento\Framework\Config\Reader\File in /home/hgfvhx/public_html/vendor/magento/framework/Config/Dom.php on line 384

PHP extensions:-

xmlreader:enabled

xmlrpc: enabled

xsl: enabled

dom: enabled

what the problem take all day searching no solutions worked :/.


texts: How to get value from core_config_data table and set as default value in config.xml file in magento2

texts:
I want to add value from

BLOG > General > Store Information > Store name and set value in General > General > Store Information > Store name

which i added.

How it is possible? Please help me...

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

            <class>separator-top</class>
            General
            <tab>abc</tab>
            <resource>abc_Blog::config_blog</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                Store Information

                <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    Store name

                </field>
                <field id="display_text2" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    Store name2

                </field>
            </group>

    </system>
</config>


texts: Rendering Terms and Conditions on CMS Page?

texts: I'd like to render my Terms and Conditions on a CMS page, and it'd be best if these were pulled from the same Terms and Conditions as configured in Stores -> Terms and Conditions, so that they stay synchronized with each other. Any tips on how to achieve this? Thanks!


texts: How to run cronjob without command in Magento 2?

texts:
At my current host, i can only set cron jobs with URL and not with command.
Is there a way to run the Magento 2 cron jobs inside a php or sh file that i can run it over a URL?


texts: How to add new custom fields in existing GraphQL API (Query and Mutuation)?

texts:
I have basic knowledge about GraphQL. Now, I would like to convert my knowledge into action. For that, I want to know about few things like how can I add my custom field to any GraphQL Query and mutations. I have also read some blog posts for this but they don't have proper guidance which I am looking for.

Can someone please explain with example of extending an existing GraphQL API for both Query and Mutations? That would be really handy.

Thanks in advance!


texts: Magento 2 : Add to compare and add to wishlist with ajax

texts:
How to do add to compare and add to wishlist functionality using ajax.
I want to do ajax functionality for wishlist and compare in homepage hot seller block products and listing page products.

Without reload page using ajax add to wishlist and add to compare functionality.


texts: How to change Wishlist button color once product added to Wishlist using controller

texts:
How to change the wishlist button color once the products added to the wishlist.I am getting an error while using a controller.
Ref:
1)https://magento.stackexchange.com/a/256570/57334
2)https://magento.stackexchange.com/a/266125/57334 (Controller)


texts:
I have an API URL of SMS Gateway :

https://smsexample.net/test/api.php?username=xxxx&password=xxxx&from=xxxx&to=xxxx&text=xxxx

How can I make REST API using this gateway, so can call the API in my mobile app?


texts: How to install themeforest-claue-clean-minimal-magento-2-theme in magento 2?

texts: Getting error of theme not found while installing the theme.


texts: Magento 2 - core/resource getConnection()

texts:
I have the following Magento 1 code and i would like to know the Magento 2 equivalent of the code.

I've looked around on the web but unable to find a proper solution.

Mage::getSingleton('core/resource')->getConnection('core_write')

I was able to find the function getConnection() at \Magento\Framework\DB\Query but it does not take any parameters.

Thanks in advance


texts: How to get the newsletter subscriber box and show the custom Module in Magento 2

texts:
I have created the Custom footer page and it is showing fine with 5 columns. Here I want to show the Newsletter Subscriber box in my custom .phtml file for this I tried to get <?php echo $block->getChildHtml('newsletter'); ?> and <?php echo $block->getChildHtml('form.subscriber'); ?> But nothing to display here.
For this I have written below code.

layout/default.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">

        <referenceContainer name="footer-container">
            <referenceBlock name="footer_links" remove="true"/>
            <referenceBlock name="report.bugs" remove="true"/>
            <referenceBlock name="form.subscribe" remove="true"/>

            <block class="Magento\Theme\Block\Html\Footer" name="custom_block" as="custom_block" template="Test_CustomFooter::custom.phtml"/>
        </referenceContainer>

</page>

templates/custom.phtml

<?php /** @var  \Magento\Theme\Block\Html\Footer $block */ ?>
......code.....

EMail

                    <?php echo $block->getChildHtml('newsletter'); ?>

.......code......

So could you please suggest me how to display here..


texts: How embedded CSS in transactional email works?

texts:
I have a very frustrating issue with the Magento 2 sales order emails.  Through experimentation, I worked out the locations of the many files that are used to comprise these emails.

At some point, I edited what I believe was

/app/design/frontend/themefolders/web/source/_email-extend.less

to alter the CSS there to check if that makes a difference to the resulting sales emails.

The confusion I have is that sometimes editing this seems to influence the resulting emails, sometimes not.

My question is, how do I clarify for sure what .less / .css files are being used as the source for the CSS that I believe is embedded into emails.  I'm not sure if the normal css that is in the pub/static folders of magento comes into this or not.   Clarification about the exact source files for email css would be great.


texts: print.less file error when run deploy command

texts: When running php bin/magento setup:static-content:deploy command it shows above error, I just replace the magento 2.1.6 files to magento 2.1.0 files now theme working fine but when run deploy command it shows the error.Please help somebody..


texts: Static blocks rendering short code on front end - after whitelisting

texts:
I am hoping someone can offer some advice / direction.  I have a problem with Magento static blocks that I can seem to sort out even after a lot of reading / testing.  I know enough to be dangerous with Magento but not a whole lot more so please forgive any terminology errors.  I will try and explain the best I can ( sorry for the wall of text ).

The situation.

I had a site on 1.9.0.1 and tried an over the top updated to 1.9.2.4 and ran into problems with hangs on processing the order and customer registration that I believe were related to JS issues with an outdated template ( which I did not update initially ).
I then did a fresh install of 1.9.2.4 to a subdomain, installed the updated ‘compatible’ template and connected up a copy of the original database.
I updated my template customization (css etc), copied over the media directory and copied across the code for a custom module we had developed that programmatically includes static blocks into products (based on product attributes) in TWO of the top level product categories.  After some issues with finding all the customized code directories (just my lack of knowledge) I got this working, and the checkout and customer registration all working again, products, images etc. all working.
Initially NONE of the blocks were not working at all on the over the top upgrade, but I searched around and worked out the changes with 1.9.2.2 with block whitelisting - and on the over the top upgrade, ALL BLOCKS are working. Both the programmatically and short code included blocks.
HOWEVER - I have a number of other categories that build their product descriptions through including a number of blocks via short code.  All included via standard short code {{block type="cms/block" block_id=  ….. }} – all are cms/block and include simple html, images etc.  No php, JS etc.  This is where the problem starts.

So…. The problem.

With the fresh install and blocks types whitelisted – the programmatically included blocks are working fine, however the short code blocks are failing to render – instead it is actually displaying the full short code on the front end.
The over the top upgrade is working for both programmatically and short code includes, so this leads me to believe it is something to do with the template update, but I just can’t seem to find the problem, and I have been scouring the interwebs with no luck.  It seems others with problems of blocks not displaying are generally to do with whitelisting.
EDIT: I just tested if {{block...  is working in in CMS pages, and it IS working?

Some notes.

I have tried adding short code to the category description for both types of categories ( ones where blocks are added programmatically and via short code ) and they are not working under either.
Compilation is disabled, cache constantly cleared and index refreshed every test.
Logs are turned on and I am getting no errors / warning at all.  I know it is working as there were errors early on that I cleared.
There are no php error’s showing on the server.
No errors or warning showing in firebug console.
Both the over the top install and upgrade are running on the same server ( the upgrade is running under a sub domain ).

I have spent a lot of time searching for solutions, trying different things and learning a lot, however I just can’t seem to work out the ussie, or find posts anywhere others having similar problems.  For all I know there is a simple switch I have failed to throw to allow the rendering of the blocks or something but I have painfully gone over every setting I can find, and everything seems to match between the two sites.  Also, when I implemented this all on the old site, the short code inclusions just worked!

If anyone has thoughts, suggestions, or even ideas of where to go from here it would be greatly appreciated.


texts: Getting all of the orders from the last 24 hours using the SOAP API

texts:
This is my SOAP client code:

$client = new SoapClient('mybaseurl/api/v2_soap?wsdl=1');
$session = $client->login('myuser','mypass');
$filter = array('filter' => array(array('key' => 'status', 'value' => 'processing')));
$results = $client->salesOrderList($session, $filter);

This returns me a list of orders with the processing status. But I want to  get all of the orders made from the last 24 hours or 48 hours . How can i filter this ?

I tried smth like this:

$fromDate = date('Y-m-d H:i:s', strtotime('-1 days'));
$todayDate = date('Y-m-d H:i:s');
$filter = array('filter' => array(array('key' => 'created_tat', 'value' => array('from'=>$fromDate, 'to'=>$todayDate))));

But i got this message: Array to string conversion. Any idea ?


texts: Adding a "Buy Now" button to specific configurable products depending on attribute

texts:
I'm looking to add a "Buy Now" button to specific simple products that are part of a configurable product. This button would link to a third party site with the SKU of the chosen simple product. Not all of the products would need this button added - only ones with a certain attribute added to them.

I seem to be having some issues doing this, as I can only get the Buy Now button to appear on the configurable product no matter what product has been selected from the dropdown. I also can't seem to get the SKU of the simple products to attach to the URL the Buy Now button links to. This was done creating a module that overwrites the configurable_product_view files.

From this image only the top two simple products would replace the "add to cart" button with a "buy now"; with the bottom two keeping the add to cart process as normal.

Under the "in stock" label I have the SKU of the selected simple product displaying, and this changes based on which one is selected by the user.

Any help would be appreciated.

Thanks.


texts: I'm looking into chef to automate Magento deployments — both into standard Magento hosting options as well as environments like EC2.  I've googled around and I see numerous recipes, but none really strikes me as a canonical one.  Is there's a particular chef script that's better/the best?  Also, if you've done chef deployments with PHP before, what's one thing you wish you'd know when you were starting out?


texts: Join table to product/catalog collection to display new custom column in catalog grid

texts:
I am trying to add a column to the catalog/product grid. So far I have been able to create the column but have been unable to populate it here is what it looks like now

So far I've tried this

$collection->joinField('volume_id',
            'fpm_volumes_volume_product',
            'volume_id',
            'product_id=entity_id',
            null,
            'left'
        );
$collection->joinField('volume_name',
            'fpm_volumes_volume',
            'volume_name',
            'entity_id=volume_id',
            null,
            'left'
        );

and this

    $volIdsTable = Mage::getSingleton('core/resource')->getTableName('fpm_volumes/volume_product');
    $collection->getSelect()->join(array('volIds' => $volIdsTable), 'e.entity_id = volIds.product_id', array('volume_id'));
    $volsTable = Mage::getSingleton('core/resource')->getTableName('fpm_volumes/volume');
    $collection->getSelect()->join(array('volumes' => $volsTable), 'main_table.volume_id = volumes.entity_id', array('volume_name'));

but none of that works and when I try the second way, using getSelect(), I get this error

Column not found: 1054 Unknown column 'main_table.volume_id' in 'on clause'

my association table looks like this

and the custom table from where I want to retrieve the data(volume_name) looks like this

In the catalog/product table the entity_id(s) are the same as the product_id(s) in the fpm_volumes_volume_product table. However, the volume_name is in the fpm_volumes_volume table.

So can some one guide me through the process of "adding" volume_name to the catalog/product collection by using fpm_voulmes_volume_product as the "bridge" between the catalog/product collection and my fpm_volumes_volume table in order to populate my Volumes column? Thanks everyone!


texts: Add custom option in Layered Navigation-Magento

texts: Is there any way to add the custom option in the Layered navigation of Magento?


texts: How to get product count from a filtered product collection specific to category

texts:
I have below script of product collection :

$collection = Mage::getResourceModel('catalog/product_collection');
$collection->addAttributeToSelect('*');
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
$collection = $collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left');
$collection->getSelect()->group('e.entity_id');
// here I have some custom attribute filter
$collection_array = $collection->getData();
$categoryids = array_column($collection_array, 'category_id');
$categoryids = array_unique($categoryids);
foreach($categoryids as $categoryId)
{
    $_category = Mage::getModel('catalog/category')->load($categoryId);
    // here I want to count product from $collection which are in $_category
}

How to get products count from product collection for each category?


texts: Unable to get to the System Configuration in Magento 2

texts:
Fresh install of both community and enterprise Magento 2. I am trying to get to the System configuration but i am seeing this instead.

What do I need to do?
If I put in my credentials from magento.com I get this page:

I do see some posts online that do show a page similar to the Engerprise 1.14 System->Configuration so I know it exists, what am I doing wrong?


texts:
We have worked on Magento-1.9.1.1 version website on Porto theme. Website is working fine. Now we want to make mobile application for Android/IOS.

For that, we hired app developers and they are working on react-native(for both android and IOS).
They need REST API's to build the app.

I have referred the following  :
Devdocs tutorial for Rest API

It's good and giving the basic api's. But, App developers are asking API for login and sign up etc.

Can anyone give the list of REST API's which are generally using for the Mobile application?

And give me the solution to create them.


texts: 'bin/magento setup:upgrade' Failing after update

texts:
I am trying to upgrade from 2.1.9 to 2.2.0.

I have updated my composer.json file and have successfully run composer update. Have successfully upgraded from 2.1.6 to 2.1.9 but keep getting the below error going from 2.1.9 to 2.2.0.

[root@lmwebserver mageliveNOV]# php bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/html/mageliveNOV/generated/code/Composer
/var/www/html/mageliveNOV/generated/code/Magento
/var/www/html/mageliveNOV/generated/code/Symfony
The directory '/var/www/html/mageliveNOV/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
Module 'Aitoc_OrdersExportImport':
Module 'Magento_Store':
Module 'Ebizmarts_AutoResponder':
Module 'Magento_Directory':
Module 'Ebizmarts_Mandrill':
Module 'Magento_Eav':
Upgrading schema.. SQLSTATE[23000]: Integrity constraint violation: 1062 , query was: ALTER TABLE `eav_attribute_group` ADD UNIQUE `CATALOG_CATEGORY_PRODUCT_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE` (`attribute_set_id`,`attribute_group_code`)
[root@lmwebserver mageliveNOV]#


texts: Magento 2 Data Migration Tool Not connecting to remote server

texts:
Im trying to migrate from magento1 to magento2. Installed data migration tool. filled everything out correctly in my config file.

             <source>
            <database host="mymagento1.com" name="magento1db" user="magento1user"
    password="mypassword"/>
            </source>
            <destination>
            <database host="localhost" name="magentodb2" user="magento2user"
password="mypassword"/>
            </destination>

my magento 1 install is on a remote server. I have enabled remote access to that database.

Problem I having is when I run

/magento migrate:settings --reset

/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.1/config.xml

I get this error

  [Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [1045] Access denied for user
  'magento1user'@'s1.mydomain.com' (using password: YES)

  [PDOException]
  SQLSTATE[HY000] [1045] Access denied for user
  'magento1user'@'s1.mydoamin.com' (using password: YES)

Seems to be trying to use my magento1 user name to connect to my localhost server to make a connection. I did not specify my hostname for my localhost (destination server) and while running the migrate command it responds back with my hostname from destination and my username from source.

I also added in

<source_prefix>magento1user</source_prefix>
<dest_prefix>magento2user</dest_prefix>

I get the same results.
Am I missing something?


texts: Magento 2 : Get Category Attribute Value By Option Id

texts:
How to get category attribute value by option id in magento 2.

Thanks


texts: Get country id in magento one page checkout after shipping method chosen

texts:
I am trying to get country ID in magento template files in the one page checkout... after the shipping method is chosen.

The issue that I am getting is that the country actually showing reflects the billing address, and not the shipping address when shipping address is different.

This is what I'm using in the template:

$this->getQuote()->getShippingAddress()->getCountryId();

I have also tried this with the same result:

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCountryId()


texts: Magento 1.9 open header mini cart when product is added to cart

texts:
I want to open the header cart when a product is added to the cart on my Magento 1.9.4.1 store, by adding the class display:block; to my header cart div after the page is re-loaded.

I use the default cart method, that the page refresh and the product is added to the cart.

My header cart got the div <div class="cart-wrapper" id="mini-header-cart">

How can I achieve this?

EDIT:

I am almost there using the success message element, but I do not want to check the length of the success message, but if the success message contains a add to cart phrase. Any ideas how to change my code?

CODE:

<script type="text/javascript">
                    if ($('.messages .success-msg').length){
                     var screen_width = $(window).width();
                    if (screen_width > 780) {$('.cart-container .cart-wrapper').css('display','block');}
                    }
                </script>


texts:
I've a strange problem with checkout page and totals row. Originally in module tax in file subtotal.html there is

I want to replace this with div but:

when I add some html after
 it doesn't appear
when I replace
 with
 on page it is replaced to
when I add some text after  it also doesn't show on page

Why it is working so strange? How can I debug it?


texts: Magento 2 - How can I pull Category Names into Product Page and separate multiple Categories?

texts:
I want to pull category names into my title.phtml template. I am using the code below. It pulls in all categories. However, It does not put spaces in between the categories if the product is a part of more than one. How can I add spaces between categories here?

 <?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');
$categories = $product->getCategoryIds();
foreach($categories as $category){
    $cat = $objectManager->create('Magento\Catalog\Model\Category')->load($category);
    echo $cat->getName();
    }

?>


texts: General error: 1005 Can't create table 'magento2.easylife_table' in magento

texts:
I have creating a table through my package(Ics->easylife->sql->install-0.0.1.php) file, but it's returning error.

can anyone tell me where I went wrong?

my code is

<?php

$installer = $this;

$installer->startSetup();

$table = $installer->getConnection()

->newTable($installer->getTable('easylife/easylife_table'))

->addColumn('easylife_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'unsigned'  => true,
        'nullable'  => false,
        'primary'   => true,
    ), 'EasyLife ID')

->addColumn('nom', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array( ), 'Number')

->addColumn('prenom', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array( ), 'Pre Number')

->addColumn('telephone', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array( ), 'Telephone Number')

->addForeignKey($installer->getFkName('easylife/easylife_table', 'easylife_id', 'easylife/easylife_table', 'easylife_id'),
        'easylife_id', $installer->getTable('easylife/easylife_table'), 'easylife_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)

->setComment('Easy Life Table');

$installer->getConnection()->createTable($table);

$installer->endSetup();

thanks in advance.


texts:
This is the first time I want to run cron for indexation every hour. I found multiple tutorials but none of them give me what I'm looking for or skip some steps.
I'm using OVH as a web hosting, Magento 2.3.
Help, please.


texts: How can I get full-sized image on swatch attribute? Magento 2.3

texts:
I added swatch images for my brand.

I get swatch data in my template:

$swatchData = $block->getSwatchData();

Next step - I show image inside my template:

$swatchThumbPath = $block->getSwatchPath('swatch_thumb',
                        $swatchData['swatches'][$option]['value']); ?>
<img src="<?=$swatchThumbPath?>" alt="<?= /* @escapeNotVerified */ $label['label'] ?>">

But on page I have compressed picture 110x78 pixels:

How can I get full-sized picture from swatch data?


texts: magento2 - one page checkout missing back button

texts:
I'm missing the "back to store button" on the default one page checkout in magento2.

Is there a way to create one?


texts: magento2 Item (Magento\Sales\Model\Order) with the same id "x" already exist

texts:
I am trying to join sales_flat_order and sales_order_item table.

protected function _initSelect()
{
    parent::_initSelect();

    $this->getSelect()
            ->joinLeft(
                ['secondTable' => $this->getTable('sales_order_item')],
                'main_table.entity_id = secondTable.order_id',
                array('*')
            )
            ->group('secondTable.item_id');
}

If I print the query (echo  $this->getSelect()) , I got the the output as "SELECT main_table., secondTable. FROM sales_order AS main_table LEFT JOIN sales_order_item AS secondTable ON main_table.entity_id = secondTable.order_id GROUP BY secondTable.item_id ".
I executed this query in the database and got the correct output.

But when I tried to display it in my grid I'm getting the error as "Item (Magento\Sales\Model\Order) with the same id "4" already exist"

My actual question was,
I need to display all items in an order.
If I had only one item in an order it's working properly but fails if there is more than one item in an order.


texts: Magento 2.4 stock_item in /v1/products API

texts:
The stock_item seems deprecated in the Magento /V1/products endpoint there is some mentioned here:
Magento 2: Get Product Stock status details in Rest API
Magento 2: Rest API add "stock_item" in to the list of the products
I tried the solution from @Amit Bera but it doesn't seem to do the trick. Anyone any advice on how to get the stock_item info back in /V1/products?
I specifically need to call with ?searchCriteria, so: /v1/products/?searchCriteria


texts: Magento2 how to define theme in my themes.js

texts:
What is the correct way to define theme in theme.js

  dev/tools/grunt/configs/themes.js

My theme in app/design is  Hose/Fit

<theme>: {
  area: '<area>',
  name: '<Vendor>/<theme>,
  locale: '<language>',
  files: [
    '<path_to_file1>', //path to root source file
    '<path_to_file2>'
  ],
dsl: 'less'
}


texts:
[Magento 2]
I have a maintenance page which appears on some order view (eg: xxx/sales/order/view/order_id/123/xxx) on my BO of Magento (but not on all pages).
I try to understand what is the issue but I don't find any log: I take a look in system.log, exception.log and in all file.log I have without success.
My maintenance page is configured in BO > Stores > Configuration > Advanced > System > fastly Configuration > Custom Synthetic Pages > Error/Maintenance Page HTML. Currently, it's only display "Maintenance Page.".
What can I put in this html page to display the issue or at least, where the logs are created?


texts: Is there a way to add product price to Share wishlist email template?

texts:
I'm trying to add the product price to the share wishlist email but I am not having any luck.

Here's what I have tried so far:

  app/design/frontend/enterprise/allbeauty/template/wishlist/email/items.phtml

I've done a var_dump of the $_product variable and can see that price is available so I have added this code to line 38

<?php echo $_product = $item->getProduct(['price']) ?>

This hasn't worked so I would like to know if there is a better way to do it?


texts: Load Specific Brand Products on Top On Category Page

texts:
I have a new store on magento. I was trying to showcase product list from a category where certain brand items always load at first.

For eg. I have menu tab called Laptops, if someone click on laptops, first Toshiba laptops appears and there after other brand products should appear Lenovo, Dell and so on.

This seems to be sorting of items. At the moment I can see Sort By: Position, Name and Price. I was wondering if can enable such sorting where particular brand items appear first.

Thank you in advance.


texts: How to Create Custom RMA form on frontend of Magento 2?

texts:
I want to create a custom form in frontend and using this form customer for Fields
I have some fields like below.

Customer First Name*

Customer Last Name*

Company

Mobile No.*

Email (Should be a valid email)

Order no. (Validate the order no. against orders in Magento)

Picture* (Image field)

Error Description

Fields marked with an asterisk are mandatory
And below fronted the field is stored in the values of fields in the database of Magento 2
And Display the values in the backend Grid of Magento 2
So give me a suggestion or related link to create the below module custom module in Magento 2
Thank you.


texts: I want to create new account after place an order.but Database is not saving any data

texts:
public function execute(\Magento\Framework\Event\Observer $observer)
{
    $email   = $observer->getEvent()->getData('email');
    $address = $observer->getEvent()->getData('address');

    // Get Website ID
    $websiteId  = $this->storeManager->getWebsite()->getWebsiteId();

    // Instantiate object (this is the most important part)
    $password  = $this->encryptor->getHash($this->createRandomPassword(9), true);
    $customer  = $this->customerFactory->create();
    $customer->setWebsiteId($websiteId)
            ->setStoreId($this->storeManager->getStore()->getId())
            ->setEmail("abc@abc.com")
            ->setFirstname("Allen")
            ->setLastname("Allen")
            ->setGroupId(1);

    $newCustomer = $this->customerRepository->save($customer, $password);
    echo $newCustomer->getId();
}

I can print customer id,but database is void


texts: Magento 2 - get categories by using interfaces in API

texts:
In Magento 2, you're supposed to use the interfaces in Magento's API. So, when you want to fetch product(s), you'd use \Magento\Catalog\Api\ProductRepositoryInterface. That works great and it's very convenient.

Now when I want to get a list of categories, based on my search criteria. What's the best way to approach this? I don't really see the options, because:

\Magento\Catalog\Api\CategoryRepositoryInterface only supports a single entity, no getList() or something like that.
\Magento\Catalog\Model\ResourceModel\Category\Collection\Factory is used a lot from what I've seen from community code. However, this class is deprecated, which clearly means it shouldn't be used.
\Magento\Catalog\Model\CategoryFactory is also used a lot. It's a dynamically generated factory. Developers would use this factory to create a category model and get it's collection. That seems really awful to me, but it's a way to go I guess..


texts: Sort by Price : Configurable products have wrong order

texts:
On category page, sorting by price return products in wrong order for configurable products. Lets say i have a product with 3 associated products with prices $10, $20, $30.  The sort by price will order this product by adding all prices 10+20+30= 60 .
Is there any setting in the admin im missing?
Checked the theme file and i think it is getting products collection by this :

Mage::getSingleton('catalog/layer')->getProductCollection();


texts: Display block on email order confirmation only when check / money order

texts:
I want to display a li in the order confirmation email only when the customer selected check / money order.

Is this possible and if so, how?

Thanks


texts: How to remove compare product icon from new products widget?

texts:
As the title asks, how do I remove the "add to compare" button from a "new products" widget? Currently this is what's I'm seeing ... but only within this widget:

I've got the following XML in my theme's default.xml but the compare icon is still visible in the new products widget:
<referenceBlock name="catalog.compare.link" remove="true" />
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="catalogsearch.product.addto.compare" remove="true"/>
<referenceBlock name="category.product.addto.compare" remove="true"/>
<referenceBlock name="crosssell.product.addto.compare" remove="true" />
<referenceBlock name="related.product.addto.compare" remove="true" />
<referenceBlock name="upsell.product.addto.compare" remove="true" />
<referenceBlock name="view.addto.compare" remove="true" />
<referenceBlock name="catalog.compare.list" remove="true" />


texts: Free gift was added to your shopping cart

texts:
Free gift %name was added to your shopping cart

When I add a promo product to the cart, a free product is added with it, I need to translate the popup message into another language, but I can't find anywhere how to do this, where I can edit this text in Magento 2, maybe someone knows?


texts: Magento 2.2.3 CE, price is zero when adding to cart

texts:
I have a very strange issue. After upgrading from 2.1.3 to 2.2.3 CE I've noticed one strange issue, which is as I found out, related to MSP_CashOnDelivery module. But please let me explain the scenario.

When the module is disabled, add to cart works properly, and mini-cart is displayed after product is added to cart. But, when the module is enabled data this is not the case.

Here are the call and the response:

/en/customer/section/load/?sections=cart&update_section_id=false&_=1525081553687

cart
{
    summary_count: 0,
    subtotalAmount: null,
    subtotal: "AED0.00",
    data_id: 1525081565,
    extra_actions: "",
    isGuestCheckoutAllowed: true,
THIS => items: [] <= THIS,
    possible_onepage_checkout: true,
    subtotal: "AED0.00",
    subtotalAmount: null,
    subtotal_excl_tax: "AED0.00",
    subtotal_incl_tax: "AED0.00",
    summary_count: 0,
    website_id: "1"
}

Did anyone have a similar case, because I still can't find what exactly is causing this issue.


texts: How to know and remove unused custom modules / extensions in Magento 1.x and Magento 2.x?

texts: I have two different stores of Magento 1.9 and Magento 2.3. I need to know details of unused custom extensions and third party modules of my stores which are enable but not used for long time, so that I can disable/remove it. Is there any method or way to do that in Magento ...?


texts:
Whenever I try to delete a tax rate, I get below error message.

Tax rate cannot be removed. It exists in tax rule

I checked there is no tax rule in admin. I have deleted all tax rules.

UPDATE

I have found some posts asking to delete data from tax_calulation table manually. Is it correct solution?


texts: Magento2 multipart emails with text/html and text/plain

texts:
Magento2 sents multipart emails but the message only has text/html MIME parts, the text(plain) part is missing. So email clients which can/may not display html will show nothing and spamfilters like SpamAssassin will complain about MIME_HTML_ONLY.

Is there a way to bring Magento2 to send proper multipart emails? Can the text/plain part be generated automatically from the html version of the email?