texts:
Good Morning.  I have a problem that I think is not derived from the canonicals because they are well configured but I do not know the reason for the problem

I have it configured the canonicals in the following way. Use category path for redirects Urls of articles NO Use canonical link meta tags for Categories and Products YES

The problem that I see is if for example you enter a category like https://www.shopmami.com/productos-por-marcas/childhome/balancines-childhome and you open for example this article https: //www.shopmami. com / wooden-toys / balancin-infantil-scooter-childhome.html the url that shows is not https://www.shopmami.com/productos-por-marcas/childhome/balancines-childhome but that is https: / /www.shopmami.com/juguetes-de-madera/balancin-infantil-scooter-childhome.html

If you look for the product in Google and enter it you can see that the breacrumb shows instead the following category https://www.shopmami.com/productos-por-marcas/childhome/balancines-childhome
Someone could help me?
Thank you.


texts: Code optimization, adaptation to a large number of conditions

texts:
I need to make a condition, if the server code has a certain value, then it will set the appropriate currency.
I did this via an if else condition. But if there are many 5+ conditions, it will look wrong. Help optimise and shorten the code by using an array
        $de = 'de';
        $currencyEuro = 'EUR';

        $uk = 'uk';
        $currencyPound = 'GBP';

        if ($this->getStoreCurrency() !== $currencyEuro && $_SERVER['HTTP_LANGUAGE'] == $de) {
            $this->storeManager->getStore()->setCurrentCurrencyCode($currencyEuro);
        } elseif ($this->getStoreCurrency() !== $currencyPound && $_SERVER['HTTP_LANGUAGE'] == $uk) {
            $this->storeManager->getStore()->setCurrentCurrencyCode($currencyPound);
        }


texts: Magento 2 : How to Clear Previous Messages in MessageManager

texts:
I have added a below line in my observer file for the event checkout_cart_save_after

$this->_messageManager->addNotice(__("A Notice Message"));

Every time it hits observer, it displayes more than 1 message in frontend. I need to display only one message at a time. Can anyone pls help to clear the messages in message manager?

My observer logic is below:

 public function execute(Observer $observer)
    {
        allowCheckout = 1;
          //custom logic......
         if($allowCheckout == 0){
           $this->_messageManager->addNotice(__("A Notice Message"));

         }

    }

So Everytime when the event occurs it goes to observer and displays message manager notice message. It displays more than one message. I want only once the message to be displayed


texts: How to show "Out of Stock" text in dropdown option?

texts: How can I show "Out of Stock" text in dropdown option? See Chocolate Brownie Option in current and expected


texts: what is the setter method to change value of custom attribute of Item class?

texts:
I want to modify value of custom attribute of custom attribute set in observer.
I can modify some core attribute which is having setter method like
                $item->setCustomPrice($custom_price);
but I could not found any setter method for custom attribute.
I tried with like $item->setData('voucher_value', 259);
Also tried like

              $item->addOption(array(
                "product_id" => $item->getProduct()->getId(),
                "product" => $item->getProduct(),
                "code" => "voucher_value",
                "value" => serialize($results)
            ));

But could not set value.
Please Help.


texts: Magento new admin gives an error and doesn't let me log in with any other admin user

texts:
I'm using Magento 1.9.2.4 and i tried to create a user using this code that i found in someone else's answer:

define( 'USERNAME', 'supermanXX' );
define( 'PASSWORD', 'supermanXX' );
define( 'FIRSTNAME', 'Super' );
define( 'LASTNAME', 'Man' );
define( 'EMAIL', 'iam@supermanxx.com' );
include_once( 'app/Mage.php' );
Mage::app( 'admin' );
try {
    $adminUserModel = Mage::getModel( 'admin/user' );
    $adminUserModel->setUsername( USERNAME )
        ->setFirstname( FIRSTNAME )
        ->setLastname( LASTNAME )
        ->setEmail( EMAIL )
        ->setNewPassword( PASSWORD )
        ->setPasswordConfirmation( PASSWORD )
        ->setIsActive( true )
        ->save();
    $adminUserModel->setRoleIds( array( 1 ) )  // HERE
        ->setRoleUserId( $adminUserModel->getUserId() )
        ->saveRelations();
    echo 'User created.';
} catch( Exception $e ) {
    echo $e->getMessage();
}

But then i had a not so smart idea to add more than one RoleIds in the array:

$adminUserModel->setRoleIds( array( 1,2,3 ) )

Now every time i'm trying to log in with whichever user(that worked before) i get this error:

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 392507181744

How do i delete that user(and remove its roles)? :-s


texts: magento2: how to get value of custom attribute

texts: I created "unit of mass" attribute for product in admin.I want to show it in final_price.phtml page .how to call there


texts: How to send automated response mail to sender in contact us form

texts:
After submitting the contact us form in magento 2 I want to send a automated response mail to sender

I got somewhere solution for magento 1

1. Create custom event to fire once the contact form has been submitted.
2. Create another mail action in the same controller and call the mail action in the try block.

public function sendMailAction(){
$html="
put your html content here
blah blah

 ";
$mail = Mage::getModel('core/email');
$mail->setToName('Your Name');
$mail->setToEmail('Youe Email');
$mail->setBody('Mail Text / Mail Content');
$mail->setSubject('Mail Subject');
$mail->setFromEmail('Sender Mail Id');
 $mail->setFromName("Msg to Show on Subject");
 $mail->setType('html');// YOu can use Html or text as Mail format

try {
$mail->send();
Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
$this->_redirect('');
 }
 catch (Exception $e) {
Mage::getSingleton('core/session')->addError('Unable to send.');
 $this->_redirect('');
}
 }

But how to implement same thing in magento 2.


texts: Get Child Categories in catalog toolbar.phtml?

texts:
I'm trying to get a list of child categories within the toolbar.phtml but unsure how I can achieve this?

I have tried to use the category helper but this stops the category pages from loading and just shows empty white screen.

$categoryHelper = $this->helper('Magento\Catalog\Helper\Category');

foreach($categoryHelper->getChildrenCategories() as $category) {
    echo "Category Name Here?";
}

I will also need to be able to get a list of the parent category child categories if the current category doesn't have any children which would then show an active state on the current category.

Any help to be able to achieve this would be much appreciated.

Thanks


texts: How can i set product image which is in cart by observer event(checkout_cart_after_add_product) in magento 2

texts:
Below code i am doing:

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;

class CustomPrice implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer) {
        $item = $observer->getEvent()->getData('quote_item');

        $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
        $price = 100;
        $item->setCustomPrice($price);
        $item->setOriginalCustomPrice($price);
        $item->getProduct()->setIsSuperMode(true);
    }

}

Note: in above example, custom price working properly but i also need to update product image.


texts: Magento2 : Display maps on another page by clicking link of one phtml page

texts:
i want a map link on my home.phtml page (view map) .
which will redirect to other phtml page to display that map.
On home.phtml there are multiple view map available like(view map delhi,view map  america etc) i want all of them to redirect on that page
simply i want to fetch different maps for different link?


texts: Magento 1 - Automatically update backend/admin settings on a certain date and time

texts:
In germany the taxes are getting lowered because of corona at 01.07.2020 on 00:01 o'clock.
The problem is, that no one works in our company in this time, so we have to automate the setting change.
Whats the best approach to solve this? I thought of a cron job, but have no experience with it.


texts: How do I get the MySQL (updated) affected rows when using the Magento resource?

texts:
I am using following update query,

$db = Mage::getSingleton('core/resource')->getConnection('core_write');

$query = UPDATE `catalog_product_entity_decimal` val SET val.value = '11'
WHERE val.attribute_id = 75 AND
val.entity_id = (select cv.entity_id from `catalog_product_entity` as cv where cv.sku = '25' limit 1)

$afected = $db->query($query);

How could I get the affected rows count from the above query?. I have already looked on the
How do I get the MySQL affected rows using the Magento resource? - but those not works for me.

Kindly advice me on the above.


texts: Is it possible to know what link a user clicked from inside a custom module observer?

texts:
I'm trying to improve the sales pipeline of Magento 2 when allow guest checkout is disabled. By default after creating an account with allow guest checkout disabled, a user is redirected to the account center regardless of whether they clicked the account login button or the checkout button.

I would like to use an observer to redirect a user to the cart if they were prompted to log in after clicking on the cart button. Is there a way inside of my observer to know what link was clicked? (checkout or account)

I'm firing the following observer on customer_data_object_login.

Observer.php:

<?php
namespace Vendor\NameSpace\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class Redirect implements \Magento\Framework\Event\ObserverInterface
{

    protected $_responseFactory;
    protected $_url;
    protected $_session;

    public function __construct(
        \Magento\Customer\Model\Session $session,
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\UrlInterface $url
    ) {
        $this->_session = $session;
        $this->_responseFactory = $responseFactory;
        $this->_url = $url;
    }

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

        $isCustomerLoggedIn = $this->_session->isLoggedIn();

        if ($isCustomerLoggedIn) {
            $event = $observer->getEvent();
            $CustomRedirectionUrl = $this->_url->getUrl('checkout/cart');
            $this->_session->setBeforeAuthUrl($CustomRedirectionUrl);
            return $this;
        }
    }
}


texts: How can I Solve this problem the System display One or more indexers are invalid. Make sure your Magento cron job is running.?

texts: Display One or more indexers are invalid. Make sure your Magento cron job is running.?


texts: magento 2.3 how to override protected function in custom module

texts:
I want to override protected method _prepareProduct present in vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Product.php in my custom module.

I have overridden the Model file by adding preference in di.xml but it's not working.

Still, the default model is working.
I have done di:compile and setup upgrade too. There is no error showing.

Please provide a solution to override this.

Thanks!


texts: Magento 2 grid uiComponent: include a table alias in a column filter

texts:
I created a grid using an uiComponent xml file, and for the dataProvider I provided a collection which is using JOINs with some additional tables. Because of that, I'm getting the following error while trying to filter the grid by the email field:

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'email' in where clause is ambiguous

which is correct. The email field is present both in the main table and in one of the JOIN'ed tables.

So my question is: how can I make the email column filter use the main_table.email instead of just email in the query? I tried to search for solution in core uiComponents, but none of them seem to have such ambiguous columns (along with a solution for that).

My column definition looks like this:

<column name="email">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">text</item>
            <item name="sorting" xsi:type="string">asc</item>
            <item name="label" xsi:type="string" translate="true">Email</item>
        </item>
    </argument>
</column>

I also tried putting this code in the <filters> tag to check if it helps:

<filterInput name="email">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataScope" xsi:type="string">main_table.email</item>
            <item name="label" xsi:type="string" translate="true">Email</item>
        </item>
    </argument>
</filterInput>

But it turns out it doesn't. What should I do to achieve the desired effect, apart from changing the collection query itself?


texts: export action in custom admin is not working

texts:
Here is my code.

Grid.php

   protected function _prepareColumns()
        {

            $this->addExportType('*/*/exportCsv', Mage::helper('repair')->__('CSV'));
            $this->addExportType('*/*/exportXml', Mage::helper('repair')->__('XML'));

            $this->addColumn('id', array(
                'header'    => Mage::helper('repair')->__('ID'),
                'align'     =>'right',
                'width'     => '50px',
                'index'     => 'id',
            ));

             $this->addColumn('product_id', array(
                'header'    => Mage::helper('repair')->__('product_id'),
                'align'     =>'right',
                'width'     => '50px',
                'index'     => 'product_id',
            ));

            $this->addColumn('detail', array(
                'header'    => Mage::helper('repair')->__('detail'),
                'align'     =>'left',
                'index'     => 'detail',
            ));
}

Controller code

public function exportCsvAction()
    {
        //echo "exportCsvAction"; die;
        $fileName   = 'repair.csv';
        $content    = $this->getLayout()->createBlock('repair/adminhtml_repair_grid')
            ->getCsv();

        $this->_sendUploadResponse($fileName, $content);
    }

    public function exportXmlAction()
    {

        //echo "exportXmlAction"; die;
        $fileName   = 'repair.xml';
        $content    = $this->getLayout()->createBlock('repair/adminhtml_repair_grid')
            ->getXml();

        $this->_sendUploadResponse($fileName, $content);
    }


texts: Magento2: dependency injection issue in passing parameter to constructor

texts:
I have faced this issue many times, but unable to understand why?
what is the (logic/concept/approach) behind injecting any object.
i have injected few parameter to my save controller, before adding the 4th parameter it was working fine, just after adding $file error occur.

can anyone simplify understanding of dependency injection.
what all we can inject and why his fatal error comes.

<?php

namespace AB\Tester\Controller\Adminhtml\Slide;

use Magento\Backend\App\Action;
use Magento\MediaStorage\Model\File\UploaderFactory;
use Magento\Framework\Filesystem;
use Magento\Framework\Filesystem\Driver\File;
class Save extends Action{

    protected $_mediaDirectory;
    protected $_fileUploaderFactory;
    protected $_newFileName;
    protected $_slidesFolderPath;
    protected $_file;

    /**
     * Save constructor.
     * @param Action\Context $context
     */
    public function __construct(
        Action\Context $context,
        Filesystem $fileSystem,
        UploaderFactory $uploaderFactory,
        File $file
    )
    {
        /** @var TYPE_NAME $filesystem */
        $this->_mediaDirectory = $fileSystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA);
        $this->_fileUploaderFactory = $uploaderFactory;
        $this->_slidesFolderPath = "AB_Tester/";
        $this->_file = $file;
        parent::__construct($context);
    }


texts: KnockoutJS Which Model does the Minicart use?

texts:
So, i'm very new when it comes to using KnockoutJS but i've been doing some reading around it and to my knowledge each template file has its own corresponding model.

However, as i'm looking through the template file located at:

  module-checkout/view/frontend/web/template/minicart/item/default.html

I cannot find any reference to the model it is linked to. My goal is to add an afterAdd function to the foreach contained within the following code block:

This should then call the corresponding afterAdd function within the model and I can run some code. But after looking through the models located within:

  module-checkout/view/frontend/web/js/model

i'm having no luck finding it.

Update:

It is possible that I have found the corresponding file under:

  module-checkout/view/frontend/web/js/view/minicart.js

However, adding a callback function so that I can run some code in this file is still an issue.


texts: What's the effect of not checking "store view specific" option for inline translation?

texts:
I have seen some tutorials about Magento inline translation feature and in all articles people have said that we have to mark that checkbox "Store view specific" but I never check it. Is there some "consequence" for that? What does that checkbox mean exactly?

Thank u


texts:
I would like to remove the default columns control component in product_listing.xml, I tried with this code but it's not working :

 <columnsControls name="columns_controls">
     <argument name="data" xsi:type="array">
         <item name="remove" xsi:type="boolean">true</item>
     </argument>
 </columnsControls>

Thanks !


texts: Magento 2 Associate Develeper Certification Question

texts:
Q:- \Magento\Sales\Model\Api\OrderRepositoryInterface::getList accepts a
SearchCriteriaInterface to filter and sort information.
What class assists in creating an instance for SearchCriteriaInterface?
A. \Magento\Framework\Api\SearchCriteriaFactory
B. \Magento\Framework\Api\SearchCriteriaBuilder
C. \Magento\Sales\Model\Order\SearchCriteria
D. \Magento\Backend\Api\SearchCriteriaGenerator
CAN SOMEONE PLEASE EXPLAIN THIS TO ME AND WHAT IS THE CORRECT ANS FOR THIS QUESTION


texts: Magento 2 - How to affect street address in checkout forms with layout xml/ui arguments

texts:
I'm trying to set a placeholder on street address fields on shipping address form in checkout.
Followed this example:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html
I've modified my modules checkout_index_index.xml.

Most of the fields have now a placeholder in checkout by defining:

<item name="telephone" xsi:type="array">
  <item name="config" xsi:type="array">
    <item name="elementTmpl" xsi:type="string">Magento_Checkout/form/element/my-input</item>
  </item>
</item>

Telephone works. The input template is used.

The street address is a group, see magento-ui/view/frontend/view/frontend/templates/group/group.html
And it contains 2 input elements.

Can't affect these elements template from layout checkout_index_index.xml.

Last I tryed this, without success:

<item name="street" xsi:type="array">
    <item name="children" xsi:type="array">
        <item name="0" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="elementTmpl" xsi:type="string">Magento_Checkout/form/element/my-input</item>
            </item>
        </item>
        <item name="1" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="elementTmpl" xsi:type="string">Magento_Checkout/form/element/my-input</item>
            </item>
        </item>
    </item>
</item>

The keys 0 and 1 seem to be correct. I see them in the big JSON in the checkout page source, on the street group:

<script type="text/x-magento-init">
{
  "#checkout":
    "Magento_Ui/js/core/app":  { ... }
}
</script>

Anyone knows how street address input fields can be affected?

PS: Input placeholder can be enabled editing the input HTML template like here: https://stackoverflow.com/questions/35406440/magento2-checkout-form-how-to-display-placeholder-attribute-value-in-fields/


texts: How can I do a version update of my Magento 2.1 version to Magento 2.3?


texts:
I am using cloudfront cdn for which I have I created a cname in my hosting server.

cdn.abc.com  pointing to 3uuo34j3232.cloudfront.net

Can I create multiple cnames like above and use one for skin, one for js and one for media to parallize download? If this is not the correct way what is correct?

cdn1.abc.com  pointing to 3uuo34j3232.cloudfront.net

cdn2.abc.com  pointing to 3uuo34j3232.cloudfront.net

cdn3.abc.com  pointing to 3uuo34j3232.cloudfront.net

or

Create a duplicate distribution and use it?


texts:
I want to edit some css for the transaction emails in Magento 1.5.

When I edit it directly in the backend, it's not getting applied in webbased clients like Gmail. I tried looking for /skin/frontend/base/default/css/email-inline.css but it seems like there is no such file in Magento 1.5.
I did find a file /html/var/email/styles/, but again, when I change css in it, it is not getting applied in Gmail. The only thing that works is if I apply the CSS directly inline in the content, such as

... {{htmlescape var=$order.getBillingAddress().getName()}},

... {{block type='imprint/field' value='shop_name'}}. ...

... {{var order.increment_id}} ... {{var order.getCreatedAtFormated('long')}} ...

Does anyone know how to edit the CSS for all email clients?
Thank you!


texts:
I'm using the sales_order collection. Now I was able to display it in my grid custom admin page. But I want the result to display in descending order. So meaning the latest order should be displayed at the top portion. But eventhough I added the sortOrder still no luck. Am I missing something? Below is my Grid code

                    entity_id
                    asc
                    0

                    text
                    ID

                    text
                    Customer Email

            </item>
        </argument>
    </column>
    <column name="customer_firstname">
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="filter" xsi:type="string">text</item>
               <item name="label" xsi:type="string" translate="true">First Name</item>

           </item>
       </argument>
    </column>
    <column name="customer_lastname">
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="filter" xsi:type="string">text</item>
               <item name="label" xsi:type="string" translate="true">Last Name</item>

           </item>
       </argument>
    </column>
    <column name="customer_middlename">
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="filter" xsi:type="string">text</item>
               <item name="label" xsi:type="string" translate="true">Middle Name</item>

           </item>
       </argument>
    </column>
    <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" >
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="filter" xsi:type="string">dateRange</item>
               <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
               <item name="dataType" xsi:type="string">date</item>
               <item name="label" xsi:type="string" translate="true">Order Date</item>
                <item name="sorting" xsi:type="string">desc</item>
                <item name="sortOrder" xsi:type="number">1</item>
           </item>
       </argument>
   </column>

I already cleared my cache and all but it's not taking effect. Also I want the Order Date be displayed at the very first column


texts:
I'm using the code below for change order status to holded

$order->setState("holded")->setStatus("holded");
$order->save();

But after run this code, the status of order is blank, what am i wrong ?


texts: how do get link in fonts in custom theme?

texts:
I know in magento2 get media link we can use

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface')->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);

if i want get link like .../frontend/customtheme/web/fonts/. how do get it. thanks


texts: magento 2 doesn't copying product picture in tmp folder

texts:
I creating a product pro grammatically in magento2. The issue is that i can't set addImageToMediaGallery. I always receive error:

  The file "/home/xxx/pub/media/tmp/catalog/product/t/e/test.jpg" doesn't exist or not a file

My picture locating in /pub/media/testimg/test.jpg
media folder and has 777 permissions and files has same perms.
Here is a code:

$dir = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList');
$_product->addImageToMediaGallery(
    $dir->getPath('media') . '/testimg/test.jpg',
    null,
    false,
    false
);

so it looks like the system found the image but can't copy in tmp folder ? please help.


texts: For my design i am using cms block as my hero banner, how to set full width?


texts:
I am programatically doing an invoice refund, and I want to set the order status to closed after the refund has happened.

The refund works, but changing the order status doesn't.

I was kind of hoping that the refund code would set the status to Closed for me, but it doesn't, the status just stays at Processing after the refund.

Here's the refund code:

$service = Mage::getModel('sales/service_order', $order);
$creditmemo = $service->prepareInvoiceCreditmemo($invoice);
$creditmemo->register();
$creditmemo->save();

I have read that the Complete and Closed statuses shouldn't be set manually, but I do need the order status changed to closed.

Here's what I've tried, none worked for me.

1.

$order->addStatusHistoryComment("Refunded.", Mage_Sales_Model_Order::STATE_CLOSED);

2.

$order->setData('state', Mage_Sales_Model_Order::STATE_CLOSED);
$order->save();

3.

$order->setState(Mage_Sales_Model_Order::STATE_CLOSED)->save();


texts:
Is their any way we can override below template file
Magento_Sales::email/items/order/default.phtml

which is defined in
vendor/magento/module-gift-card/view/frontend/layout/sales_email_order_renderers.xml

in module ?
I have tried -  Vendor/Sales/view/frontend/layout/sales_email_order_renderers.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" label="Email Creditmemo Items List" design_abstraction="custom">
    <body>
        <referenceBlock name="sales.email.order.renderers.default">
            <action method="setTemplate" >
                <argument name="sales.email.order.renderers.default" xsi:type="string">Vendor_Sales::email/items/order/default.phtml</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="sales.email.order.renderers">
            <action method="setTemplate" >
                <argument name="sales.email.order.renderers.giftcard" xsi:type="string">Vendor_Sales::email/items/order/default.phtml</argument>
           </action>
        </referenceBlock>
    </body>
</page>

but then the file for "sales.email.order.renderers.default" block did not override.


texts: Magento1: Cart price rule for free shipping if subtotal incl. tax is over a limit

texts:
Does anyone know of a patch or extension with that I can create a cart price rule that sets free shipping if subtotal (INCL. tax) is over a certain limit?

It (still) seems to do comparison  only using subtotal without tax.

  My Settings are: Prices in the catalog are including tax, Apply
  Customer Class before Discount, Apply Discount on Prices incl. Tax.

If I create a cart price rule with Subtotal >= 19.90, this will work only if I put items that have subtotal without tax of 19.90


texts: Magento related, can I change the cron job time interval with something new from my database?

texts:
For example, I got in config,

<crontab>
    <jobs>
        <test>
            <schedule>
                <cron_expr>*/15 * * * *</cron_expr>
            </schedule>
            <run>
                <model>test/observer::saveAction</model>
            </run>
        </test>
    </jobs>
</crontab>

And at: */15 * * * *, can I call a specific time from my db? I want to let the user choose the time interval for the update function. But I am not sure if I can call something from db using php in config.xml, is there a way to put the interval for a cron job in a php file?


texts: Magento2: What is difference between ProductFactory and CollectionFactory?

texts:
What is the difference between this below code?

  Class : \Magento\Catalog\Model\ProductFactory

  Code  : $this->productFactory->create()->getCollection();

  Class : \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory

  Code : $this->collectionFactory->create();


texts: Magento 2: Only display Out of Stock products if logged in

texts:
I am building a B2B M2 website using open source 2.3.1 which will have specific customer groups. I want to display out of stock products but only when logged in. When logged out I do not want people able to see out of stock items. Is this possible? Any help would be appreciated.

Thanks.


texts: Magento 2.3 inserts admin/ in url when saving product

texts:
I get this behavior when saving product in admin area, my url is:
domain.com/mybackend/catalog/product/edit/id/1628...

when I save product I get this url:
domain.com/admin/mybackend/catalog/product/edit/id/1628...

it returns 404, if I remove admin/ from url I get correct backend page and product is correctly saved, someone can help?
Thanks.


texts: Magento 2: How to use translation to change the adminhtml button text?

texts:
I want to change the invoice button name on the sales order, how to do that using  translation (i18n)

For testing I tried to change the translation in this path /vendor/magento/module-sales/i18n/en_US.csv and then changed the admin setting but that not worked

admin > Store > Configuration > Advance > Developer > Translate Inline > Enabled for Storefront as YES

Is there any other way to override the adminhtml translation ?


texts: 2.2.3 : Are there situations when @magentoDbIsolation cannot be used in integration tests?

texts:
I'm currently experiencing a weird issue. I've written a bunch of integration tests, and it is my understanding that I can use the @magentoDbIsolation annotation to isolate my database transactions during a test (documentation).

However, I am currently in a situation where my test passes when @magentoDbIsolation is disabled, but it fails when @magentoDbIsolation is enabled. I'm asserting the actual data in the database to check if the product repository has written everything correct. The test:

/**
 * @throws \Exception
 * @magentoDbIsolation enabled
 */
public function testDifferentValuesForDifferentStores()
{
    // Create default product:
    $importValue = $this->createImportValue('abc', ['name' => 'Name', 'price' => 9.95, 'description' => 'Foo']);
    $this->productLoader->importSingle($importValue);

    // Create import values for every store code:
    $stores = $this->storeManager->getStores();
    foreach ($stores as $store) {
        // Only the name differs per store:
        $importValue = $this->createImportValue('abc', [
            'name' => "Name ({$store->getCode()})",
            'price' => 9.95
        ]);
        $importValue->setStoreCode($store->getCode());
        $this->productLoader->importSingle($importValue);
    }

    // Check if the values differ:
    foreach ($stores as $store) {
        $product = $this->productRepository->get('abc', false, $store->getId());
        $this->assertEquals("Name ({$store->getCode()})", $product->getName());
        // Check if there are no stupid duplicates stored:
        // Should be one, since only the name differs:
        // This assertion passes when dbIsolation is disabled, but fails when it's enabled
        $this->assertEquals(1, $this->resource->getConnection()->fetchOne(
            'SELECT COUNT(*) FROM `catalog_product_entity_varchar` WHERE `store_id` = ' . $store->getId() .
            ' AND attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = \'name\' AND entity_type_id = 4)'
        ));
    }
}

Now the code that handles the importing does nothing fancy. It extracts the values from my import object, creates a product and saves it in the repository. It does this in an emulated environment, but I've also tested without this but the test still fails.

Does anyone has a clue what might be going on here? Are there specific situations where the @magentoDbIsolation can trigger specific gotcha's that you should be aware of?


texts: Certs-Buzz and Magento Certified Developer Exam Training Material

texts:
I'm attempting to take the test for the Magento Certified Developer.

I wonder if the appropriate responses given to each address are dependable?

Since when I resulted in these present circumstances question today,

For an attribute to be loaded on a catalog/product object, which two of the following conditions
must be satisfied? (Choose two)
A. The eav_attribute table must contain a row defining the attribute's properties and its entity type.

B. The attribute must have a backend model configured in the XML config.

C. The attribute must be part of the attribute set pertaining to the object being loaded.

D. There must be a record of the attribute on the catalog_product_super_atti:ibute table.

E. There must be a column added to the catalog_product_entity table.

Answer: A , C

I am little Bit Confused Can I Someone tell about A , C

Source Link: https://www.certsbuzz.com/magento-certified-developer-questions-bank


texts: Magento 2 - Hide/Show custom EAV attribute after if condition

texts:
I created a new EAV attribute using this code :

'information',
    [
        'group' => 'Content',
        'type' => 'int',
        'default' => null,
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
        'visible' => false
    ]

PS: I added this attribute to the product form

this attribute is by default hidden, but I want to visible it after a condition, is there any method to do that?


texts: All Page Cache (FPC) Invalidated When Saving Any Product

texts:
I am trying to work out why page cache is invalidated/cleared whenever a product is opened and saved.

The expected behaviour: would be that if you edit product A all product pages and categories that product A shows on would be invalidated.

What is actually happening: Editing any product clears ALL pages cache.

What I have tried?
Disabling modules, this has not made any difference.
Disabling cronjobs. seems to improve the situation but is not a proper fix. Has anyone else had this and have any ideas what is causing it?

EDIT: By disabling and enabling all Cron Jobs I have narrowed it down to

indexer_update_all_views / Magento\Indexer\Cron\UpdateMview

as soon as this is enabled it starts clearing ALL page cache as soon as a product is saved.

Currently, its schedule is * * * * * , would there be any harm in setting it to a much longer time span?

EDIT 2: After a huge amount of digging it appears that we are not the only ones seeing this,

See these github tickets:

https://github.com/magento/magento2/issues/25670
https://github.com/magento/magento2/issues/4688


texts: Send mails to stock sources after sources selection in order processing

texts: i wanted to send emails to the sources emails stored in config every time i process order so the get notified before actual shipping process starts, anyone have any idea how to do this.? Any event i should listen for this..? Please suggest


texts: Error while creating Quick simple product for configurable product

texts:
Today I came across with one of the errors which is while creating a quick simple product for configurable product, i was getting an error which is:

  "An error occurred while saving the product. Image file was not found"

Can anyone please help me on this?


texts: How do extensions override non-rewritable classes

texts:
I was going to put together a tiny extension to enable Template hints under global scope, but got stuck trying to rewrite core/template.

Class rewrites only work for classes instantiated via one of Magento's methods to do so (helper, getModel, getSingleton). For abstract and heavily-extended-from classes you seem to be left with the option of local/Mage overrides.

Two questions:

Is there a smart way to avoid local/Mage overrides at all times?
If there isn't, how do you go about including such overrides in community extensions?


texts:
I read this post explaining the details of the System->Cron settings in the Magento admin section, but I am still not clear on how the settings all affect the execution of my cron job.

I my system cron tab is set to execute cron.php every 5 minutes:

*/5 * * * * php -f /mysite/cron.php

I configured a job within a custom module's config.xml file to run one time per day:

<schedule>
    <cron_expr>30 10 * * *</cron_expr>
</schedule>

And my admin settings are:

The cron job I am interested in runs first at 17:30 and then again at 17:35.

The record of this job in cron_schedule is:

It looks like the problem is that Generate Schedules Every runs twice within the Schedule Ahead for time frame and sets the job twice, but the descriptions I have read on the admin settings led to to think that having Schedule Ahead for be a greater time frame than Generate Schedules Every was desirable.

What do I need to change in my admin settings?


texts: Anyone know about collectTotals() Magento 2.2?

texts: I need to know about collectTotals(); and How to work it in Magento 2.2? Have any link about collectTotals please provide to me?


texts: Undefined property: SimpleMagento\\Custom\\Controller\\Test\\First\\Interceptor::$getRequest ....... In controller

texts:
Error in controller :- Undefined property: SimpleMagento\Custom\Controller\Test\First\Interceptor::$getRequest .......While fetching data from custom form. Can someone provide me solution or how to fetch data from custom form to controller ... Magento 2

Or else how to fetch data from custom form and store it to the custom table in DB.


texts: Magento 2.2 display brand logo product detail page

texts:
Please can someone provide step by step instructions or provide tutorial on how to display brand logo on product detail page above the add to cart button.

Thanks


texts: Observer checkout success - change customer group switch country

texts:
Is this possible to get customer country (or country code) in checkout success observer ?
I would like to create a custom module (it's okay) to change customer ID switch his country after he orders.

Is this possible to get customer country in my Observer.php ?

Thanks a lot


texts: Multiple PayPal IPN notifications in Order Comments

texts:
This is something I've recently noticed happening on Magento CE 1.9.2.2. The code responsible is at app/code/core/Mage/Sales/Model/Order/Payment.php:492 which has a strange to do note in the comments: TODO: eliminate logic duplication with capture()

I am trying to work out the root cause here. There aren't other obvious events that Magento will be firing at those times (other invoices or orders that are generated around the times listed above).

Is it possible that PayPal is actually sending these notifications?

What would be triggering this?

I am using PayPal Express.

UPDATE

It does seem to be PayPal's IPN triggering capture():

store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:12:26:27 +1100] "POST /paypal/ipn/ HTTP/1.0" 302 4443 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:12:26:30 +1100] "POST /customer/account/login/ HTTP/1.0" 302 7238 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:13:09:14 +1100] "POST /paypal/ipn/ HTTP/1.0" 302 4443 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:13:09:17 +1100] "POST /customer/account/login/ HTTP/1.0" 302 7214 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:13:27:33 +1100] "POST /paypal/ipn/ HTTP/1.0" 302 4443 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:13:27:36 +1100] "POST /customer/account/login/ HTTP/1.0" 302 7232 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:14:34:40 +1100] "POST /paypal/ipn/ HTTP/1.0" 302 4443 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:14:34:43 +1100] "POST /customer/account/login/ HTTP/1.0" 302 7226 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:14:59:19 +1100] "POST /paypal/ipn/ HTTP/1.0" 302 4443 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
store_ssl_access.log:173.0.81.1 - - [17/Dec/2015:14:59:22 +1100] "POST /customer/account/login/ HTTP/1.0" 302 7220 "-" "PayPal IPN ( https://www.paypal.com/ipn )"

This is only a small part of the server log however I can confirm the times of the order comments and these IPN calls actually match.


texts: Magento 2 : After login need to redirect on same page instead of customer Dashboard

texts:
After login redirect user on previous page from front-end.

I am using the login pop-up and all default functionality. Also the Admin configuration Redirect Customer to Account is set as No. But it redirect me on Customer Dashboard.


texts: Magento Advance Search Exact Result For Particular Attribute Value

texts:
I have a magento store where i have used magento advance search on home page. Works fine. In search form there is an attribute (caliber) which is actually a text type attribute but i m showing this attribute as dropdown in fronted (Used custom query to fetch the attribute value of all the product). It's  also working fine. I want to show the exact result with this attribute value. Example : if caliber value is 9mm then only this product should show but it rather shows other products whose attribute value is 7mmX39mm  since this has 9mm as well.
I have changed search type mode from LIKE to FULLTEXT but both of mode are giving same result for me. Any help will be highly appreciated.


texts: How to get the store id for customoptions?

texts:
I have 3 languages in my site. I need to add different titles based on language. If I add through back end it will take much time (more than 300 values I have to enter for each product). If I get the store id I can add it through the script. But I am not getting the store ID. Can anyone help to get this?

Here is my code:

<?php
require dirname(FILE) . '/../../app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
ini_set("display_errors", "1");
error_reporting(E_ALL);
header('Content-type: text/html; charset=UTF-8');
class customOptions extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
    public function launch()
    {
        state = $this->_objectManager->get('\Magento\Framework\App\State'); //instance of state
        $state->setAreaCode('frontend');
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); //instance of Object manager
        $productId = 17;
        $product = $objectManager->create('\Magento\Catalog\Model\Product')->load($productId);
        $file = fopen("test.csv","r");
        $valuesArray = fgetcsv($file);
        for($i =0;$i<count($valuesArray) ;$i++)
        {
            $values = [ 'record_id'=>$i, 'title'=>$valuesArray[$i],
            'price'=>0, 'sku'=>$valuesArray[$i], 'price_type'=>"fixed",
            'sort_order'=>$i, 'is_delete'=>0 ]; $finalArray[] =$values;
        }
        fclose($file);
        foreach ($product->getOptions() as $custom_option)
        {
            if ('test' == $custom_option->getTitle())
            {
                $custom_option_values = $custom_option->getValues();
                $custom_option->setValues($finalArray); $product->save();
            }
        }
        return $this->_response;
    }
}

Thanks in advance.


texts: Can't change custom option price or/and price type

texts:
Well I went through all possible questions and answers. I can change any value regarding a custom option except for the price. Below is my code.

$oProd = Mage::getModel('catalog/product')->load(theId);

$values = array();
foreach ($oProd->getOptions() as $o) {
   $p = $o->getValues();
   if($o->getTitle() == 'a specific custom option') {
       foreach($p as $v)
       {
           $values[$v->getId()]['title']= $v->getTitle();
           if($v->getTitle() == 'a value') {
                $values[$v->getId()]['price']= 10.0000;
           }
           else {
                $values[$v->getId()]['price']= $v->getPrice();
           }

           $values[$v->getId()]['store_id']=0;
           $values[$v->getId()]['option_type_id']= $v->getId();
           $values[$v->getId()]['option_type_price_id']= $v->getId();
           $values[$v->getId()]['sku']= $v->getSku();

           $v->setValues($values);
           $v->saveValues();

           if($v->getTitle() == 'a value') {
               // here I can see my updated price correctly.
               echo $v->getPrice();
           }
        }
   }
}

$oProd->save();

This does not update the product custom option price. I can however change title, sku, etc. What is the problem? Thank you!

Update:

The price and the price type are both stored under the table catalog_product_option_type_price in the database. It seems that I can't change any data on that table. I don't know why though.

Might be related: From Magento Admin > System > Configuration > Catalog > Catalog > Price > Changing to "Website", I see my price changed (through getPrice()), however this does not make a change on neither database nor Magento Admin.


texts:
I override Mage_Newsletter_SubscriberController, in config.xml i'm defined:

<routers>
            <hn_con>
                <use>standard</use>
                <args>
                    <module>Hn_Con</module>
                    <frontName>con</frontName>
                </args>
            </hn_con>
            <newsletter>
                <args>
                    <module before="Mage_Newsletter_SubscriberController">Hn_Con</module>
                </args>
            </newsletter>
        </routers>

it's worked, but Newsletter/Manage not working. Why? I just override Mage_Newsletter_SubscriberController not override Mage_Newsletter_ManageController. Who can explain to me, please ?


texts: How to translate text without auto translate magento

texts:
I have a text after installing a payment module which I can not translate in any way. I have opened the magento translator but it does not include this text. How can I translate this?

EDIT2:
I have added translate line to pl_PL.csv in payment module use notepad:

"Pay using Masterpass","Zapłać kartą Masterpass"

Then I refresh page and no see any result.

Of course before refresh, I run some command:

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

Impossible edit name in backend:


texts:
I'm trying to understand exactly how / when LESS files get compiled and unfortunately I'm not much further than what I started.

I tried installing grunt, but I'm having all kinds of permission problems...but that's kind of a separate issue. Even if I have to run all the commands necessary manually that's ok, even though it's kind of inefficient.

From all the documentation I've read, it seems like the following should compile LESS but it doesn't seem to be working:

Clear out pub/static, var/view_preprocessed, var/generation
Creating symlinks to LESS files using bin/magento dev:source-theme:deploy --type=less --locale=en_US --area=frontend --theme=MyVendor/mytheme
Deploying static view files using bin/magento setup:static-content:deploy
I think that should be it, but maybe I'm missing something. Doing the above does not get the _custom.less file I created compiled into the correct file (styles-m.css in this case).

The only way I can get it to work, is to change the mode from developer to production w/ compilation on (which errors, but again separate issue).

Something in the compilation process is getting the CSS from my LESS file and compiling it, but that seems to be the only thing that works.

I have a decent amount of experience w/ Magento 1.9 and below and I'm getting to the point where I might do the project using that vs. Magento 2.1. I've already lost a lot of time just trying to figure out how to make simple CSS changes.

Any help would be greatly appreciated.


texts: How to setup a modal popup login form when click on login rather rendiring into a login page

texts:
I am new to magento2. I want a pop login form modal when I click on the login button.
please help in achieving it.


texts: Magento 2 product content editor is trimming content after adding content

texts: I am trying to add the content of my product. Written successfully the whole content but when I save editor is trimming my content after a specific length. Can someone review this how can I restrict to write the content before adding or increase the trimming length.


texts: Adding new admin role programmatically don't work (Magento 2.3.1)

texts:
I try to add a new role programmatically using this code :

<?php
    namespace ModuleNameSpace\YourModuleName\Setup;

    use Magento\Framework\Setup\InstallDataInterface;
    use Magento\Framework\Setup\ModuleContextInterface;
    use Magento\Framework\Setup\ModuleDataSetupInterface;

    /* For get RoleType and UserType for create Role */;
    use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
    use Magento\Authorization\Model\UserContextInterface;
    /** * @codeCoverageIgnore */

    class InstallData implements InstallDataInterface {

    /** * RoleFactory * * @var roleFactory */
    private $roleFactory;

    /** * RulesFactory * * @var rulesFactory */
    private $rulesFactory;

    /** * Init * * @param \Magento\Authorization\Model\RoleFactory $roleFactory * @param \Magento\Authorization\Model\RulesFactory $rulesFactory */

    public function __construct(
    \Magento\Authorization\Model\RoleFactory $roleFactory, /* Instance of Role*/
 \Magento\Authorization\Model\RulesFactory $rulesFactory /* Instance of Rule */
/*this define that which resource permitted to wich role */ ) {
    $this->roleFactory = $roleFactory;
    $this->rulesFactory = $rulesFactory;
    }

    /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */

    public function install(
    ModuleDataSetupInterface $setup,
    ModuleContextInterface $context) {
    /** * Create Warehouse role */
   $role=$this->roleFactory->create();
   $role->setName('YourRoleName') //Set Role Name Which you want to create

   ->setPid(0) //set parent role id of your role
   ->setRoleType(RoleGroup::ROLE_TYPE)
   ->setUserType(UserContextInterface::USER_TYPE_ADMIN);

    $role->save();
    /* Now we set that which resources we allow to this role */ $resource=[
        'Magento_Backend::admin',
                    'Magento_Sales::sales'
       ];

    /* Array of resource ids which we want to allow this role*/
    $this->rulesFactory->create()->setRoleId($role->getId())->setResources($resource)->saveRel();
    }
    }

and I run the setup:upgrade command, but when I go to the User roles I can't found it.

PS: my module setup is '0.0.0.1'

is there any solution?


texts: Telephone Number Validation Error Magento 1.8.1

texts:
I am getting a "This is a required field" error during customer checkout when the customer enters a phone number with hyphens are parenthesis. When special characters are not used it works without issues. Anyone have a solution for this problem?

Thanks!


texts:
I  have created custom place order action, below:

define(
[
    'Magento_Payment/js/view/payment/cc-form',
    'jquery',
    'Magento_Payment/js/model/credit-card-validation/validator',
    'Magento_Checkout/js/action/set-payment-information',
    'Magento_Checkout/js/model/full-screen-loader',
    'Magento_Payment/js/view/payment/iframe'
],
function ($, Component, setPaymentInformationAction, additionalValidators, fullScreenLoader) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'VendorName_SampleModule/payment/method'
        },

        getCode: function() {
            return 'vendorname_samplemodule';
        },

        isActive: function() {
            return true;
        },

        validate: function() {
            var $form = $('#' + this.getCode() + '-form');
            return $form.validation() && $form.validation('isValid');
        },
        /**
         * Prepare and process payment information
         */
        preparePayment: function () {

          var card = function(){
            return {
              'card_number'     : $("#vendorname_samplemodule_cc_number").val(),
              'card_exp_month'  : $("#vendorname_samplemodule_expiration").val(),
              'card_exp_year'   : $("#vendorname_samplemodule_expiration_yr").val(),
              'card_cvv'        : $("#vendorname_samplemodule_cc_cid").val(),

              // Set 'secure', and 'gross_amount', if the merchant wants transaction to be processed with 3D Secure
              'secure'       : false,
              //'gross_amount'   : $("#price").val()
              'gross_amount'   : 10000
            }
          };

          Veritrans.token(card, callback);

          function callback(response) {
                if (response.status_code == '200') {

                     $("#vendorname_samplemodule_token_id").val(response.token_id);
                    // $("#vendorname_samplemodule-form").submit();  <-- not working
                    // PlaceOrder();

                } else {

                    console.log('Error');
                }
              }

        }
    });
}
);

If response code 200, PlaceOrder() function triggered.  I have no idea how to trigger Placeorder()


texts: Upgrade Magento from 2.1 to 2.2.1 with sample data using composer

texts:
What steps do I need to follow to upgrade a demo installation with sample data from Magento 2.1 to the latest 2.2 version?

Instructions that work for Magento Commerce (Enterprise Edition) as well as Open Source (Community Edition) if possible.


texts: How to sync database between local or staging and the live store

texts:
I am coming from Wordpress and the way I sync my database there is by using a plugin to pull and push databases between too environments, and I was wondering if there is a similar approach with Magento 2 if not than what is the best way?

Also I want to know what are they tables that I need to change once I pushed or pulled a database. From what I can see I only need to change the links on core_config_data

Thanks


texts:
I've got this error when run "bin/magento setup:upgrade".

Module 'Magento_Catalog':
Running schema recurring...

  [PDOException]
  SQLSTATE[HY000]: General error: 1826 Duplicate foreign key constraint name 'mydb/CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID'

What can cause it?


texts: Move pub/media/catalog and /downloadable files to another server?

texts:
Is it possible, with Magento 2 to move product images and downloadables files (attached to downloadable products type, and sold) to another server and keep things still working ?
I'm not talking about AWS or other similar clouds but just a regular linux filesystem on another server.
Anyone already achieved this ?
Thanks,


texts: Magento 2 How to create checkbox field in widget

texts:
I have a custom widget in which I need to create the checkbox field in one of my widget. I am using parameter type as block
Below is my code
1 . widget.xml file
<widget class="Sandesh\ProductWidgets\Block\Widget\WhatMakesItFabulous" id="what_makes_it_fabulous">
        What Makes It Fabulous
        <description>what makes it fabulous</description>
        <parameters>
            <parameter name="checkbox" xsi:type="block" visible="true" required="true" sort_order="10">
                Select Checkbox
                <block class="Sandesh\ProductWidget\Block\Adminhtml\Widget\CheckBoxChooser" />
            </parameter>
        </parameters>
</widget>

CheckBoxChooser filer

use Magento\Backend\Block\Template;
use Magento\Directory\Helper\Data as DirectoryHelper;
use Magento\Framework\Data\Form\Element\AbstractElement as Element;
use Magento\Framework\Data\Form\Element\Factory;
use Magento\Framework\Json\Helper\Data as JsonHelper;

class CheckBoxChooser extends Template
{

/**
     * @var Template\Context
     */
    private $context;
    /**
     * @var array
     */
    private $data;
    /**
     * @var JsonHelper|null
     */
    private $jsonHelper;
    /**
     * @var DirectoryHelper|null
     */
    private $directoryHelper;
    /**
     * @var Factory
     */
    private $elementFactory;

    /**
     * @param Template\Context $context
     * @param Factory $elementFactory
     * @param array $data
     * @param JsonHelper|null $jsonHelper
     * @param DirectoryHelper|null $directoryHelper
     */
    public function __construct(
        Template\Context $context,
        Factory $elementFactory,
        array $data = [],
        ?JsonHelper $jsonHelper = null,
        ?DirectoryHelper $directoryHelper = null
    ) {
        parent::__construct($context, $data, $jsonHelper, $directoryHelper);
        $this->context = $context;
        $this->data = $data;
        $this->jsonHelper = $jsonHelper;
        $this->directoryHelper = $directoryHelper;
        $this->elementFactory = $elementFactory;
    }

    public function prepareElementHtml(Element $element): Element
    {
        $config = $this->_getData('config');
        $input = $this->elementFactory->create('checkbox', ['data' => $element->getData()]);
        $input->setForm($element->getForm());
        $input->setConfig($config);
        $element->setData(
            'after_element_html',
            $input->getElementHtml()
        );
        return $element;
    }

Below is my output I can see my checkbox but even after checking and save it wont show it as checked after coming back


texts: add html tags in excel sheet for product descriptions

texts:
we are planning to upload products using "import products" using csv.

we have lot of descriptions , we have to display description in table format.

is there any way to add html tags in excel sheet.

please help me to find some solution..


texts: Magento2: What are the differences on API Enterprise?

texts: What are the exclusive features that are provided on Magento 2 Enterprise edition API comparing with the Community edition?


texts:
I am getting the same error over and over again on a SOAP request of a Magento 1.9 shop.

If I open the SOAP url directly in my browser (https://www.ourshop.com/shop/index.php/api/v2_soap/index/) I get this message:

<faultstring>
SOAP-ERROR: Parsing WSDL: Couldn't load from '<same url but removed due to too low reputation>?wsdl=1' : failed to load external entity "<same url but removed due to too low reputation>"
</faultstring>

I know this thing is working, cause our dev environment it gives me a proper answer on the call.

I tried adding the domain to the server hosts file, but that didn't work. PHP versions of our dev and live environment are different so that could be it.

SOAP is installed:

# php -i | grep soap Configure Command =>  './configure'  '--with-apxs2' '--with-curl=/usr/local/lib' '--with-gd' '--with-ttf' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pdo-mysql=/usr' '--with-pcre-regex=/usr/local' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-xsl' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-magic-quotes' '--enable-safe-mode' '--enable-soap' '--enable-sockets' '--enable-mbstring' '--enable-zip' '--enable-wddx' soap soap.wsdl_cache => 1 => 1 soap.wsdl_cache_dir => /tmp => /tmp soap.wsdl_cache_enabled => 1 => 1 soap.wsdl_cache_limit
=> 5 => 5 soap.wsdl_cache_ttl => 86400 => 86400

PHP version is:

# php -v
PHP 5.5.34 (cli) (built: Apr  7 2016 10:19:11)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.20, Copyright (c) 2002-2016, by ionCube Ltd.
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

OpenSSL has been installed:

# openssl
OpenSSL> version
OpenSSL 1.0.1e-fips 11 Feb 2013

Just don't know now what?

edit:
Thanks for the support! I tried following:
- Curl the url when logged into the server gives the same result as when I try to load the page in my browser. All the same "SOAP-ERROR: Parsing WSDL: Couldn't load from..." error.

It also doesn't matter if I load ..../api/v2_soap/index/ or .../api/v2_soap/
All the same "SOAP-ERROR: Parsing WSDL: Couldn't load from..." error.

Today I tried to rule out some possibilities.
1. I installed a fresh Magento install on the same server. The server is loading the soap url correctly with http:// but I get the same error when loading the page on https://

I installed the empty Magento on another server (with pretty a similar installation of CentOS 6 / Apache / PHP). The soap url is loading correctly on http:// and https://

Conclusion: my production server is having trouble with SOAP & SSL combo.

I compared http-ssl.conf files of both server. The're similar!?


texts: Magento 2 : my custom menu is not displayed in admin panel

texts:
I was creating a custom menu in Magento 2 but this was not being shown!

file location:
Magento2Root/app/code/Cloudways/Adminmenu/registration.php

other files:module.xml

third file: menu.xml

screenshot of my code


texts: Mini cart does not show on custom theme header

texts:
I have added custom theme with custom header but mini cart does not show on header.
Here is my code
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>

        <referenceBlock name="header.container" remove="true" />
        <referenceContainer name="page.wrapper">
            <block  class="Magento\Framework\View\Element\Template" name="custom_header" template="Magento_Theme::header.phtml" before="header.container"/>
        </referenceContainer>
         <move element="minicart" destination="custom_header"/>
        <move element="currency" destination="custom_header"/>
        <move element="logo" destination="custom_header"/>
          </body>
</page>


texts: magento 1.14 customer login hangs on some accounts

texts:
I am looking for an answer for this weird issue but can't find anything that helps.
I have magento enterprise edition 1.14.0.1 and some customers aren't able to login into their account area for particular store website. Website just hangs and show the login page or this error page

If I open the particular customer from admin : Dashboard -> Customers -> Manage customers -> edit particular customer. Issue get resolve for that particular customer.
I am using redis for backend session/cache and default FPC.
Any suggestion would be appreciated.


texts:
I am migrating from Apache to Nginx magento. The site works fine but when I try to access the admin generates a 404.

www.mydomain.com/admin

This is the configuration that I have on my server

server {
    listen  80;
    server_name www.mydomain.com;
    root /home/mydomain/public_html;
    index index.php index.html index.htm;
    keepalive_timeout 300;
    access_log   logs/access.log;
    error_log    logs/error.log;
    location / {
        if (!-e $request_filename) {
                rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
        }
        if ($uri ~* "\.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$") {
                expires max;
                break;
        }
    }
    location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
            access_log        off;
            log_not_found     off;
            expires           30d;
    }
    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }
    location ~ .php$ {
        if (!-e $request_filename) { rewrite / /index.php last; }

        expires        off;
        fastcgi_pass   unix:/tmp/php.sock;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE default;
        fastcgi_param  MAGE_RUN_TYPE store;
        include        fastcgi_params;
    }
    location /nginx_status {
            stub_status on;
            access_log   off;
            deny all;
    }
    location /RequestDenied {
            return 500;
    }
    if ($bad_method = 1) {
            return 444;
    }
}

Versions

Nginx/1.4.1
Magento 1.8
MySql 5.1.73


texts: Manually/Automatic Test Magento Installed Patch

texts:
What are the potential methods/ways to test the installed patches in website,
to make sure they are working well & not disturbing any other existing functionality in website ?
I am looking for methods or ways to test magento 1 installed patches.
Manual or Automatic.
Feel free to share thoughts.


texts: Magento 2.1.3 Extremely High MySQL CPU Usage

texts:
We recently started having big issues with our website slowing down quite often due to maxed out CPU usage (MySQL process using 200% CPU). The CPU usage is constantly at 60-85% and maxes out multiple times throughout the day where the entire website hangs. We rarely had this issue in the past but we did have occasional CPU spikes caused by MySQL. We had approximately 30,000 products when we got this server but we now have nearly 200,000 products. Our traffic also increased by about 30%.

We are also at 75% constant RAM usage (out of 32 GB) where MySQL is using most of it. Even though the RAM usage is high, it isn't really an issue since it is mostly stable.

As our catalog was growing, we had issues with the database where large operations would often fail (such as catalog search indexing). I am no server optimization expert but I tried using tools such as mysqltuner to tweak the settings and it helped but now I don't know what to do anymore to optimize it further. Unfortunately, I cannot detect a pattern in the CPU spikes. Sometimes it happens with 25 concurrent visitors and other times it is fine with 50 concurrent visitors.

Please help me figure out if my hardware simply isn't powerful enough anymore or there's something wrong with the configuration! I feel like Magento is using an unreasonable amount of resources. Here's a quick summary of our setup and MySQL config file:

Dedicated Server

Xeon E3-1270 v6
500 GB SSD drive
32 GB RAM

Store

2 storeviews
200,000 products
4,000 daily visitors (~50 concurrent visitors during peak hours)

MySQL my.cnf file

[mysqld]
skip-external-locking
max_allowed_packet = 268435456
sort_buffer_size = 1M
net_buffer_length = 16K
innodb_file_per_table
thread_cache_size = 32
query_cache_limit = 2M
key_buffer_size = 32M
innodb_autoextend_increment = 512
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 128M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
query_cache_type = 0
query_cache_size = 128M
join_buffer_size = 32M
table_open_cache = 2000
performance_schema = ON
innodb_buffer_pool_size = 12G
innodb_log_file_size = 1G
innodb_buffer_pool_instances = 12
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 2
max_connections = 400
max_user_connections = 300
innodb_thread_concurrency = 0
max_heap_table_size = 512M
tmp_table_size = 512M
innodb_use_native_aio = 1
default_storage_engine = MyISAM
default-storage-engine = MyISAM
open_files_limit = 10000

UPDATE

As many of you requested, here's more info on my setup:

I use Redis as cache storage and session storage
I am NOT using Varnish yet as my theme requires modification to support full page cache. The header block isn't cacheable. This is something I want to implement soon.
I am NOT using a CDN because all my users are within Canada
OP Cache is enabled
JS CSS HTML min, merge are all enabled
Flat catalog is enabled
No suspicious cron jobs
Production mode is enabled

Below are results of top commands at high load. I/O usage seems to be pretty low. At the same moment I took the screenshots, the access logs showed high activity from Google bots. Even though the number of active users was only 30, the browsing speed of the bots was very fast, quickly clicking through category pages and applying filters etc..

iotop

htop

top


texts: How can I write this sql query following the Magento Way?

texts:
How can I write this unsecure, ugly, query following the Magento way without using collection?

select (select sum(points) FROM ".$this->getTable('mymodule/registry')." where points < 0 and entity_id=".$customerId.") as points_spent,
(select sum(points) FROM ".$this->getTable('mymodule/registry')." where points > 0  and entity_id=".$customerId.") as points_received,
(select sum(points) FROM ".$this->getTable('mymodule/registry')."  where entity_id=".$customerId.") as points_current

EDIT

A possible solution.

In a resource model I can put something like this:

$adapter = $this->_getReadAdapter();

        $receivedPoints = $adapter->select()
            ->from(array('mymodule/registry'), array(new Zend_Db_Expr('sum(points)')))
            ->where('points > ?', 0)
            ->where('entity_id = ?', $customerId);

        $spentPoints = $adapter->select()
            ->from(array('mymodule/registry'), array(new Zend_Db_Expr('sum(points)')))
            ->where('points < ?', 0)
            ->where('entity_id = ?', $customerId);

        $query = $adapter->select()
            ->from(
                array('mymodule/registry'),
                array('current_points'  => new Zend_Db_Expr('sum(points)'),
                      'received_points' => new Zend_Db_Expr('(' . $receivedPoints . ')'),
                      'spent_points'    => new Zend_Db_Expr('(' . $spentPoints . ')')
                )
            )
            ->where('entity_id = ?', $customerId);
        return $adapter->fetchRow($query);


texts: system.log shows two lines DEBUG (7): 4 and DEBUG (7): 6 when home page is loaded

texts:
I cant for the life of me figure this out.
these two lines get added to var/log/system.log

2015-09-23T07:32:09+00:00 DEBUG (7): 4
2015-09-23T07:32:09+00:00 DEBUG (7): 6

every time home page is loaded. It only does it on home page and not catalog, product view or cms. Eventually the log becomes hundreds of megabytes if i dont watch it. I have disabled almost all of my 3rd party modules and cleared cache but still shoes up. Help please???


texts:
Under: http://polesto.com/pole-quiz#
I'm trying to get jQuery plugin to excecute, but currently I'm facing a dead-end. The jquery is run under noConflict mode, but the excecution is not running under these or many other trial runs.

Anyone care to enlighten me, as js with magento


texts: Magento connect manager redirects to homepage

texts:
I am facing the issue of when I click on Magento Connect Manager it redirects to the homepage of my site with the URL:

www.mysite.com/?return=https%253A%252F%252Fwww.mysite.com%252Findex.php%252F12345abc%252F

My permission settings for downloader/index.php is 644 with version 1.9.1.0 installed. I have:

Downloaded a fresh copy and reinstalled downloader to my store root directory
Deleted my var/cache and var/sessions
Deleted connect.cfg and cache.cfg from downloader folder

I've tried all suggestions I could find but none of them seem to work. Any help one this issue would be greatly appreciated.


texts: How to add a custom field in Customer module in Magento 1.8.1?

texts:
I would like to add a Custom Field in Customer Registration, Edit and same should allow from Admin also?

Also it should be able to add via SOAP method.

I am using magento CE 1.8.1.

Thanks in advance.


texts: Magento2 how to associate attribute options to exist attribute?

texts:
I have created a brand attribute at admin end for product and associated to default set.

Now i have more than 300 options want to associate.

How to associate programmtically from csv/excel/text file ?


texts: What to consider to choose in Magento 2.0.x and 2.1.x?

texts:
What are the technical points that I need to consider to choose Magento 2.0.14 or Magento 2.1.6? (Or any 2.0.x comparing to 2.1.x)

Seems like the both are the last versions available and we haven't some CLI commands and params on 2.0 versions.


texts: What is the table sequence_cms_block for?

texts:
So when trying to schedule a CMS update we were getting a foreign key constraint error.  This was related to sequence_cms_block and cms_block.

It seems like sequence_cms_block is a single column and simply repeats block_id from the cms_block.  I'm having trouble understanding the purpose of this table since these two queries appear to be equivalent:

Select block_id from cms_block

Select * from sequence_cms_block

So I'd love to understand, why does the sequence_table exist?


texts: Creating a custom homepage template in Magento2

texts:
As all you know that magento2 have some layout template like 1column , 2 columns-left , 2 columns-right , 3 columns and I want to create custom homepage layout template in Magento2 for that I follow few tutorial and create module and files as said in that links but none of them are working and I can't get "home page" layout in cms page -> design tab.

I follow below all links but none of working so anyone have proper solution please share.

first link

second link

third link

forth link

Ablove all solutions are not working.


texts: Proper use of Heading (,...) tags for SEO on Product Page

texts:
I've done a lot of searching and can't seem to find a straight answer and conflicting information. Since this applies to all who have a Magento eCommerce site, I thought I would post the question here.

Here is what I am assuming is correct:

H1 Product Name

H2 Product Short Description / Product name above the description (I've seen this done on large eCommerce sites and do not know if this is proper)

H3 Product Long Description / Product Specifications / Reviews

H4 Product Price

EDIT: Not sure if MPN (Manufacturer Part Number)  would fit into this?

Question 1: What is the proper usage of H tags on the product view page?

And as a second portion to my question, (again based on large eCommerse sites) I have mashed together the product name with the product short description as an H1 tag (the short description is not present on my site).

EXAMPLE:

  Product name:  Canon LS-100TS Product  Short Description: 5936A002AA - LS-100TS, LCD 10 digits

Final output name in front end (H1):

  Canon LS-100TS 5936A002AA - LS-100TS, LCD 10 digits

Question 2: Can this be negatively viewed by search engines or is it acceptable?


texts: Create and add attribute group to all attribute sets

texts:
I need to create and add an attribute group to all attributes sets in an existing install (CE 1.6.2).

I have found some scripts for creating an attribute group, but I can't seem to find anything on how to add that attribute group to all the existing sets.

Any help will be highly appreciated.


texts: Hoe to Enable Specific Payment Method for Specific Store Magento 2?

texts:
How to we enable specific payment method for specific store Store ? like as I want to enable COD only for French store. what is path of system.xml for COD in Magento 2.4 ?
Thanks & Regards


texts: Upgrading to php 7.0 is not applying shopping cart price rules in magento 1.9.2.1

texts:
I am using flat rate shipping of type per item on products and applying shopping cart price rule for free shipping if order value (subtotal) is greater than 1000. This is working fine if i am using php 5.5.9.

I recently upgraded to ubuntu 16.04 from 14.04 but it installed with php 7.0.8 and now this shopping cart price rule is not being applied as shown in screenshots below.

Php versions then

and now

Shopping cart price rule settings

Flat rate shipping setting

Frontend earlier with php 5.5.9

Below 1000
shipping charge is display and added to grand total

above 1000
shipping charge is not displayed and grand total is same as subtotal

Frontend now with php 7.0.8

Initially whole magento itself wasn't loading after php upgrade but looking at this link i made the necessary change and resolved that conflict but now i cannot seem to find a solution to this. Can somebody please help me on this?


texts: Magento redirect to checkout after adding to cart

texts:
I want to disable the shopping cart page. I mean that when customers add products to cart, Magento will skip the shopping cart page and redirects them to the checkout page to shorten buying process.

Is there any way to make it successful?

Please suggest me.


texts: Filter out of stock item in listing page using Event even if it is Display Out of Stock Products to yes ?

texts:
I have the situation to filter product who is having Stock Availability as 'out of stock'  in product listing page. Need to show only in product detail page. I tried with following event in my custom module

<events>
    <catalog_block_product_list_collection>
      <observers>
        <test_instockonly_list>
          <type>singleton</type>
          <class>test/observer</class>
          <method>addInStockOnlyFilter</method>
        </test_instockonly_list>
      </observers>
    </catalog_block_product_list_collection>
</events>

and method 'addInStockOnlyFilter' in observer filter to add additional query to filter out of stock item

/**
   * Observes the catalog_block_product_list_collection event
   */
  public function addInStockOnlyFilter($observer){
    $observer->getEvent()->getCollection()
      ->joinField('stock_status','cataloginventory/stock_status','stock_status',
        'product_id=entity_id', array(
          'stock_status' => Mage_CatalogInventory_Model_Stock_Status::STATUS_IN_STOCK,
          'website_id' => Mage::app()->getWebsite()->getWebsiteId(),
        ))
    ;
  }

After clear cache and run the listing page. Still i can see out of stock item from product detail page.

What was i missed here. Kindly advice


texts: Error Payment Method braintree credit card

texts:
I have a error in my website https://kiraliving.com

I did the testing by environment sandbox credit card by paypal testing and it works perfectly but when I put it live production it keeps thinking and frozen Edit. I don't know why I am looking the error for one week and nothing

I Need you help

Regards,

Felix Lung


texts: Best way to learn Magento 2 step by step Guide?

texts:
Best way to learn Magento 2 step by step Guide ?

Can anyoune suggest me best Magento 2 tutorial .

Step by step guide .


texts:
I have a search autocomplete to search a products. If it works other modules are not working (banner slider, brand logo slider, product slider, sticky menu and sticky header).

autocomplete has 2 js files:

js/ves_autocomplete/noconflict.js
js/ves_autocomplete/ui/jquery-ui-1.8.16.custom.min.js

Banner slider has 4 js files

js/jquery.js
js/base.js
js/lightslider.js
js/homePage.js

Menu has 2 js files:

js/menu/jquery-1.js
js/menu/menu-jquery2.js

Sticky Header, Menu have

jquery/2.1.3/jquery.min.js
jquery/1.9.1/jquery.min.js
js/stickyMojo.js

When I just hide all the other js fileson my site, search autocomplete works; but i need to keep this design. Does anybody have an idea to solve this problem?


texts: Multiple frontends, shared database, CDN

texts:
I would like to set up a Magento server and one of the goals will be to reliably serve China. Let's just say I'm not going to engage a CDN.

I have one frontend and backend connecting to a database in asia.
Is it possible to host a frontend in China that connects to this very same database?

I have considered the following:
 1. Two servers with their own instances of memcached connecting to the same database.
 2. Two servers sharing one instance of memcached connecting to the database.

If someone places an order on the second server, how would it trigger processing on the first if my intention is to let the first server do the crunching.

Hypothetically, this wouldn't be much different from running a backend on a different server from the frontend which I've heard is doable, so would it be safe to assume that backend processes are triggered by cron?
Is it possible to manage two frontends with a single backend?
How would extensions be affected?

My understanding of all this is quite vague so bear with me if I'm asking a stupid question.


texts: Magento 2: How to scan and delete all the system config values that start with some prefix

texts:
Required to delete all the possible values from core_config_data that are having path starts with "Softtech" via Helper/CoreConfig.php to call Model/HandleConfig.php

i.e.

Softtech/settings/enable
Softtech/settings/productpage
Softtech/settings/categorypage
Softtech/settings/cmspage
Softtech/settings/cartpage


texts: How to get all items with custom options in magento current cart?

texts:
Get cart visible products with custom options.
I have done with out custom options.

    $cart = Mage::getModel('checkout/cart')->getQuote();
           //$cart->getAllItems() //for all cart items
                foreach ($cart->getAllVisibleItems() as $item) {
                    $productName = $item->getProduct()->getName();
                    $productPrice = $item->getProduct()->getPrice();
                    /*
                    //OR
                    echo 'ID: ' . $item->getProductId() . '
';
                    echo 'Name: ' . $item->getName() . '
';
                    echo 'Sku: ' . $item->getSku() . '
';
                    echo 'Quantity: ' . $item->getQty() . '
';
                    echo 'Price: ' . $item->getPrice() . '
';
                    */
                   //get custom options
                }

How can get custom options from this

    $productOptions = $item->getProduct()
              ->getTypeInstance(true)
              ->getOrderOptions($item->getProduct());


texts: Magento 2 : How to Get List Image in Custom Folder

texts:
In magento 2, I have custom folder images in Namespace_Module:images/default.

So I want show all image/info in this folder like Wysiwyg in


texts: How to make Cart Rule test against Subtotal *with* Discount?

texts:
Consider the following snippet from my populated Magento CE 1.9.0.1 cart:

I have two test cart rules in play here:

"50 Bucks Texas", Priority 1, discounts the cart by 50.00 if the customer has selected Texas as their region.
"Over 100.00 get 10.00 off", Priority 9999, discounts the cart by 10.00 if the subtotal is greater than 100.00

As you can see both rules are coming up valid and are being applied even though after Rule #1 the subtotal (with discount) is less than 100.00. The desired action would be that Rule #2 does not validate because with Rule #1 in play the customer would be spending less than 100.00.

I have fought this issue in a number of ways to no avail. If it can be solved through rule configuration or other configuration I haven't been able to figure out what that is.

If it can be solved by modifying code can someone point me in the right direction? One thing I tried as a proof-of-concept was to add a new attribute option of "Base Subtotal with Discount" to the Cart Attributes by modifying:

/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php

class Mage_SalesRule_Model_Rule_Condition_Address extends Mage_Rule_Model_Condition_Abstract
{
    public function loadAttributeOptions()
    {
        $attributes = array(
            'base_subtotal_with_discount' => 'Subtotal with Discount',
            'base_subtotal' => Mage::helper('salesrule')->__('Subtotal'),
            'total_qty' => Mage::helper('salesrule')->__('Total Items Quantity'),
            'weight' => Mage::helper('salesrule')->__('Total Weight'),

Here I blindly added the first attribute key in that array "base_subtotal_with_discount" simply based on finding that string elsewhere in the code alongside the string 'base_subtotal'. I was hoping I would get lucky and that would resolve to what I needed but unfortunately it does not. I haven't been able to figure out where upstream I would define "base_subtotal_with_discount" so that I can use it.


texts:
I'm unable to get the value of sales_order_address table custom column value in

rest/V1/orders/?searchCriteria[filter_groups][0][filters][0][field]=status&searchCriteria[filter_groups][0][filters][0][value]=processing");


texts: Custom layout handle based on phtml file

texts:
I am trying to create a custom layout handle based on if the page/popup.phtml file is used as the template for the page.

I know how to build the module for the custom handle. The thing I don't know is the logic needed to find out if a page is using popup.phtml and if that is even possible since the layout files set a log of those templates.

Update: Here is the Observer code I am trying to use. It is failing on the line marked below (line 11) with this error:

  Call to undefined method
  KNG_LayoutHandles_Model_Observer::getLayout().

<?php
class KNG_LayoutHandles_Model_Observer {
    /**
     * Adds layout handle modal_window.
     *
     * Event: controller_action_layout_load_before
     *
     * @param Varien_Event_Observer $observer
     */
    public function addPopupHandle(Varien_Event_Observer $observer) {
        $template = $this->getLayout()->getBlock('root')->getTemplate(); //Failing here

        /**
         * Return if it is not modal window
         */
        if ($template !== 'page/popup.phtml') {
            return;
        }

        /* @var $update Mage_Core_Model_Layout_Update */
        $update = $observer->getEvent()->getLayout()->getUpdate();
        $update->addHandle('modal_window');
    }
}


texts:
I got this data scrape, an when i run profile i get this error Skip import row, is not valid value "" for field "type" i have saved it as UTF-8 without BOM. I've never attempted to upload products via a csv so i don't really know what i should be looking for.

I have attached an image of my spreadshseet columns it would be helpful if you can see whether it looks correct or even if you could attach me one so i can see the difference.


texts: Remove trailing 0's in a 5 decimal place price

texts:
I have a site where the currency has been set to 5 decimal places because they price small items individually, such as £0.00023

but some products are more, such as £1.45, but the price is being displayed to the user as £1.45000 - how can I strip the last 0's off but only to 2 decimal places - so if a price is £1.00, it still leaves at least 2 0's.

In the price.phtml, the following line displays price, but I need to somehow strip the 0's..

<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>


texts:
Currently on the product view page, there are 10 customer review per page.

I want to set the product review to display 5 product per page.

Here's the default magento function that's giving the result:

$_items = $this->getReviewsCollection()->getItems();

How can I modify this code to set 5 review per page ?


texts:
i got this weird issue on happening only on IE8, 9, 10 and 11.

I wrote some jQuery validation code for telephone field on "admin/sales_order_create/index". This code worked as expected on Firefox. But on The IE it doesnt work until I refresh the page.

The jQuery seems to stop or conflict with the prototype, and that cause the prototype not load/ other js functions not to load.

here is my inline jQuery code loaded on app/design/adminhtml/default/default/template/widget/form/renerer/fieldset.phtml (it doesn't work even if I load as an external file).

how can I make this work on all IE or reload the page without manually reload the admin/sales_order_create/index, or add classes on the form in admin/sales_order_create/index

<script type="text/javascript">
    jQuery(document).ready(function(){
        <!--Enforce maximum of 15 characters-->
        jQuery("#order-billing_address_telephone").attr('maxlength','15');

        <!--ids we will be listening for when change takes place-->
        jQuery( "#_item1telephone, #order-billing_address_telephone" ).change(function() {
            <!--if the length on the number is morethan 15 characters, then alert and disable buttons-->
            if(jQuery(this).val().length > 15 ){
                jQuery('.save').addClass("disable");
                alert("Please do not enter more than 15 Telephone numbers. Adding more will results to failure of orders!");
            }
            else if(jQuery(this).val().length <= 15){
                jQuery(".save").attr("class","save");
            }
            <!--alphanumeric are not allowed on telephone-->
            if(!jQuery.isNumeric(jQuery(this).val()) ){
                jQuery('.save').addClass("disable");
                alert("Please use numbers only. Letters and spaces are not allowed.");
            }

    });
</script>


texts:
I've looked through previous strings where other community members have changed their admin URL in the Magento admin panel.

After the change they get 404 error for the new URL path.

I've changed the env.php file:

return [
    'backend' => [
        'frontName' => 'magento'
    ],

Then I ran:

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex

Any advice would really help, I still can't access my dev site.

Thanks so much all.


texts: Magento 2: How to solve this {{system messages }} issue

texts:
How can i solve this issue ? it is weird
{{{System Messages}}{{System Messages}}{{System Messages}}{{themeMagento/backend}}}

This issue is appearing/ visible every where in the admin almost


texts: Magento content in CMS block from PHTML file

texts:
I know many people have asked this question before, but I've tried every combination I can find and I'm not succeeding, so I need some advice in case I am missing something out.

I'm trying to add the contents of a PHTML file to a CMS Block in Magento (V2.2.1)

The theme is called Infortis/ultimo

/app/code/Infortis/Ultimo
/app/design/frontend/Infortis/ultimo

I've made a child theme Infortis-child/ultimo

/app/code/Infortis-child/Ultimo
/app/design/frontend/Infortis-child/ultimo

I've tried the following combinations in the CMS Block

{{block class="Magento\Framework\View\Element\Template" template="Infortis_ultimo::custombox.phtml"}}
{{block class="Magento\Framework\View\Element\Template" template="Infortis-child_ultimo::custombox.phtml"}}
{{block class="Magento\Framework\View\Element\Template" template="Vendor_customboxmaker::custombox.phtml"}}
{{block class="Magento\Framework\View\Element\Template" template="customboxmaker::custombox.phtml"}}

I've added the custombox.phtml to the following locations and none of them are loading the content into the CMS Block.

/vendor/customboxmaker/custombox.phtml
/app/design/frontend/Infortis-child/ultimo/custombox.phtml
/app/code/Infortis/Ultimo/view/frontend/templates/custombox.phtml
/vendor/customboxmaker/templates/custombox.phtml
/app/design/frontend/Infortis-child/ultimo/templates/custombox.phtml

Please can somebody confirm what I need to add to the CMS Block and the exact path location of the custombox.phtml file?

Do I need to add anything to the /app/design/Infortis-child/ultimo/etc/local.xml file as none of the examples I've found so far have indicated this is required?

Thank you


texts: i am having this issue while calling static block in default.xml

texts:
Element 'body': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 806


texts: Proper use of  for local.xml implementation

texts:
I've scoured the web and this SE section, what I find is either not clear or completely outdated.

I keep coming across articles about a 2 level caching system, a fast backend and a slow backend.

Looking at the local.xml.additional file, there is nothing about a slow backend option, yet I keep reading about it.

So my question is there any benefit to implementing this?

Is it done as follows:

<backend>Cm_Cache_Backend_Redis</backend>
         <slow_backend>database</slow_backend>
        <slow_backend_store_data>0</slow_backend_store_data>
        <backend_options>
            <server>127.0.0.1</server> <!-- or absolute path to unix socket for better performance -->
            <port>6379</port>
...


texts: Some subcategories not showing due to too many subcategories in a particular category (in the main category menu)

texts:
Magento 1.9.4
Porto theme

We seem to have too many subcategories in a specific category and when you hover over and it drops the list down - not all of the categories are visible. Are there any possible fixes for this other than the obvious of removing some of the subcategories? Any suggestions will be appreciated. Would there also be an easy way to display the categories on the next page after someone would click on the category heading in the menu?


texts:
Simple issue :
This is one of magento template core file : vendor/magento/module-sales/view/adminhtml/templates/order/totals.phtml
How can I overide it ?
I tried to create this one but it failed
app/code/Cpy/Sales/view/adminhtml/templates/order/totals.phtml
I guess I can't just use a preference like I'm doing with class.


texts: Plugin for after add product in admin order creation for Magento 2.3

texts:
When adding products to a new order in the admin is there a function I can hook into for a Plugin for when the product is added to the order?

For certain products, I need to do additional logic to the price


texts: I changed associated products, but no change is displayed frontend

texts:
I use magento 1.9 and i have a problem:
I do changes in associated products (with saving in associated products) of a configurable product but none of changes is displayed frontent.
If a do save in the configurable product then all changes of associated products are displayed in frontend.
In admin i see the changes in associated product of configurable.
Is that a magento feature? or nothing else?

Updated:
Also i have another problem may be related with previous. I have an another shoes with sizes  38,39,40,41. After a customer order the stock of 38 is 0 (out of stock). I see that in admin. But in frontend 38 is in available option, but if someone choice it , a message dispayed that product size is out of stock. Then i go to admin and do save in that configurable product and then the size 38 disappeared in frontend.

May by i have problem with stock update and only with save in configurable products the stock become updated.

Any idea?


texts: Hide tax in Magento 2.3 New Orders Email

texts:
I'm currently using Magento ver. 2.3.4 and I'd like to hide the tax display in the sales order emails. I've added the following to my design template:
httpdocs / app / design / frontend / Infortis / ultimo_child / Magento_Sales / layout  / sales_order_email_items.xml

With the following content:
<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom">
    <update handle="sales_email_order_renderers"/>
    <update handle="sales_email_item_price"/>
    <body>
        <referenceBlock name="tax" display="false"/>
    </body>
</page>

However I am still seeing the tax being displayed in the order confirmation email. I've checked numerous other questions on here but none of the answers seem to work for me.
Could anyone please let me know what I'm doing wrong here please?
Thank you.


texts: How to remove swatch options that are not available?

texts:
in magento RWD theme, I would like to alter the way the swatches function so that subsequent swatches are dependant on the previous selection, and unavailable swatches to be removed.

For example,

a product has three options: design, colour, and size.

design 1 is available in colours white and pink and in size large. whereas, say design 2 is available in colours black, white, pink and yellow; and sizes medium and large.

so, if I were to first choose design 1, the below swatches wouldn't have options black and yellow for colour and size medium.

But if I chose design 2 it would have swatches available for colours black, white, pink and yellow; and sizes medium and large.

I believe the code that handles the swatches is in

/skin/rwd/default/js/configurableswatches/swatches-product.js

But, sadly I am struggling to identify how I can correctly amend this code to get what I'm after.

Update:

As this image shows, Menus are not available in size 'A5 double sided'. Ideally it would remove this option when Menus is chosen and add it when booking form selected. Same for others.

Update 2:

opt._e.li[method]('no-display');

Will toggle the hiding of below 'not-available' options. But, if selection made below and then above option is changed, and below selection is not available with the new above option all other options are no longer visible.

As image above illustrates:

Menu was first selected. Then the option a4 long fold was chosen. Then option above was changed to booking form. Consequently, as the option a4 long fold isn't available with booking form, a 'not-available' option is selected. Resulting in the pack size option having all of it's options hidden, as by default when this occurs Magento does this :


texts: Magento 2: Fatal error: Call to a member function getUsername() on null in

texts:
While developing in Magento 2 after a while i get the following error:

Fatal error: Call to a member function getUsername() on null in /home/magento2/domains/../public_html/magento2/vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml on line 32

I think it is after about 10 ~ 15 minutes. I need to relogin to proceed. What is the problem here and how can I solve it?