texts: How to create a product were the customer enters the price?

texts: New to Magento and I am trying to figure out how to create a miscellaneous product that initially has a price of zero.  I would like to have a field that the customer can enter any amount into and that become the new price of the product.  I have added a text field option but have no idea how to link it to update the price.  I have tried to create a event/observer but get lost in the process.  Any help or at least pointing me in the right direction would be appreciated.  I am using magento 2.2.5


texts: I am using http://devdocs.magento.com/guides/m1x/api/soap/catalog/catalogProduct/catalog_product.info.html soap v2 version . but i need to response in xml.


texts: How to create new product attribute with file type?

texts:
I have one question : Magento 2 doesn't support attribute with file type ?
I tried create new product attribute with file type but i can't see :

Anyone can help me ?


texts: Plugin to change order status after payment capture

texts:
Currently Magento2 sets the order status to the default status of the state STATE_PROCESSING when a credit card payment is captured. This is done in vendor/magento/module-sales/Model/Order/Payment/State/CaptureCommand.php in the excute function.

I am trying to make after payment capture status as "processing_invoiced" so the history item in the order saying it has capture uses the processing_invoiced status instead of resetting to the default.

I have it working with an aroundExecute:

<?php

namespace Vendor\Module\Plugin;

use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Api\Data\OrderPaymentInterface;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\Order\Payment\State\CommandInterface as BaseCommandInterface;

class InvoicedOrderStatus
{
    /**
     * Set pending order status on order place
     * see https://github.com/magento/magento2/issues/5860
     *
     * @todo Refactor this when another option becomes available
     *
     * @param BaseCommandInterface $subject
     * @param \Closure $proceed
     * @param OrderPaymentInterface $payment
     * @param $amount
     * @param OrderInterface $order
     * @return mixed
     */
    public function aroundExecute(
        BaseCommandInterface $subject,
        \Closure $proceed,
        OrderPaymentInterface $payment,
        $amount,
        OrderInterface $order)
    {

      $result = $proceed($payment, $amount, $order);

        if($order->getState() == Order::STATE_PROCESSING) {
                $state = Order::STATE_PROCESSING;
                $status = 'processing_invoiced';

                $order->setState($state);
                $order->setStatus($status);
            }

        return $result;
    }
}

But can't get it working with afterExecute.  How can I rewrite this to be afterExcute as Magento cautions against around functions when it's not needed?


texts: How to use frontend calendar localization?

texts:
I'm becoming crazy with the frontend translation of the mage/calendar widget in Magento 2.
Does somebody know how to localize it?

I have a calendar that's showing up on the front (from a bought module that has a specific class for the calendar) but I've not been able to display the months/day in French.
This specific frontend calendar is a very simple inheritance of the mage/calendar widget so I don't think that's a problem.

As the calendar widget is based on the jQuery UI calendar, I've tried to translate it as it is recommended in the jquery UI doc but it does not seem to work.

I've seen in the backend, on the product edit page, that there's a translated calendar for the date attributes 'set the product as new from' and it looks like the options of the knockout input are the following:

dateFormat:"dd/MM/y"
showsTime:true
storeLocale:"fr_FR"
timeFormat: "HH:mm"

But initializing my calendar with the following options on the front does not change anything, my calendar stay in English :

initCalendar: function() {
    $(this.element).calendar({
        dateFormat: this.options.calendarDateFormat,
        minDate: this.minDate.toDate(),
        setDate: 0,
        showOn: 'button',
        storeLocale: "fr_FR"
    });
},

I think I'm missing a little something but I don't know what and I have not been able to find any clear answer on the Internet... If anybody has already solved this issue, I would be really happy to read your answer

Thanks!


texts: Logout user from session by admin in admin panel

texts: As a admin in admin panel I want to change status of user account to inactive and after that user should be logged-out from frontend area if he is logged-in. How can I programatically log-out other front-end user by admin from admin panel?


texts: how to get product quantity in magento 2.3 in phtml file

texts:
I am using Magento 2.3 , in my case I want to test if a product has a quantity greater than or equal to 0 in the list of all product page, to add a message a customer, but I wonder how to get it, for now I can get all products and I can display the message image for all the product without test if quantity equal or grater than 0
Can anyone help me to have this test please in the product page?


texts: Magento 2 - How to run fast command line setup:di:compile?

texts:
How to run fast command line setup:di:compile.

I was waiting so long, if can you show me why?


texts: Is there any way or Extention in Magento to handle multiple payment gateways like for credit card transaction one payment gateway, for EMI transaction another payment gateway and for net banking another gateway in below screenshot way


texts: Magento 2 Checkout onepage how to create a custom step and save its value

texts:
In Magento 2.2.6 I am created the custom checkout step but its value is not saved in the order (database) I am take a reference into the following link:

  https://packagist.org/packages/sbodak/magento2-checkout-custom-form


texts:
I'm creating quote and order programmaticaly.

I can't figure out why options product are not added to my order / quote.

See :

$superAttr = $item["super_attribute"];
if(!empty($superAttr)){
    $opts = [];
    foreach ($superAttr as $va) {
        foreach ($va as $k => $v) {
            $opts[$k] = $v;
        }
    }
    $temp = array(
        "product_id" => $product->getId(),
        "qty" => $qty,
        "super_attribute" => $opts,
    );
    $buyRequest = new \Magento\Framework\DataObject($temp);
    $this->nice($buyRequest);
    $quote->addProduct($product,$buyRequest);
}else{
    $quote->addProduct(
        $product,
        $qty);
}

And my $buyRequest :

Magento\Framework\DataObject Object(
    [_data:protected] => Array(
        [product_id] => 1739
        [qty] => 1
        [super_attribute] => Array( //keys = id of the options
            [56] => 325 //multiselect id option value
            [58] => 339 // dropdown id option value
            [57] => 334 //dropodow id option value
            [61] => Semaine 20 //textfield
        )
    )
)


texts: Reliable way to determine product from product url

texts:
Is there a reliable way to determine a product from a given product url?

i.e.

http://mysite.com/clothes/tops/the-top.html

or

http://mysite.com/clothes/tops/the-top.html?___store=fr

or

http://mysite.com/clothes/tops/the-top

etc, etc

The point is that for any given valid product url, determine what product that belongs to.

Aside from the possible variations on urls, a couple listed above, there could be other variables i.e. stores, rewrites etc etc


texts: Where to find the template for sale emails in Magento 1.8?

texts:
I can't find where Magento keeps template which generates sales items in the sale emails. I need to change the colour bar on where it holds Item, Sku, Qty, Subtotal

I go to app/design/frontend/yourpackage/yourTemplate/layout/ and open sales.xml, still can't find any hint of it.

Any ideas?

EDIT:

app/design/frontend/{package}/{theme}/template/email/order/items.phtml

<?php  $_order = $this->getOrder() ?>
<table class="data-table" id="my-orders-table" summary="<?php echo $this->__('Items Ordered') ?>">
    <col />
    <col width="1" />
    <col width="1" />
    <col width="1" />
    <col width="1" />

            <?php echo $this->__('Product Name') ?>
            <?php echo $this->__('SKU') ?>
            <?php echo $this->__('Price') ?>
            <?php echo $this->__('Qty') ?>
            <?php echo $this->__('Subtotal') ?>

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

        <?php $_items = $_order->getItemsCollection(); ?>
        <?php $_index = 0; ?>
            <?php $_count = $_items->count(); ?>
        <?php foreach ($_items as $_item): ?>
        <?php if ($_item->getParentItem()) continue; ?>

            <?php echo $this->getItemHtml($_item) ?>
            <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
            <tr class="border<?php echo ($_index++ > $_count ?' last':'') ?>" id="order-item-gift-message-<?php echo $_item->getId() ?>" style="display:none;">
                <?php $_giftMessage=$this->helper('giftmessage/message')->getGiftMessageForEntity($_item); ?>

                    <a href="#" title="<?php echo $this->__('Close') ?>" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>');" class="btn-close"><?php echo $this->__('Close') ?>

<?php echo $this->__('From:') ?> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?>

<?php echo $this->__('To:') ?> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?>

<?php echo $this->helper('giftmessage/message')->getEscapedGiftMessage($_item) ?>

            <?php endif ?>

        <?php endforeach; ?>


texts: I need to create a redirect that will redirect from https://www.example.com/es to https://www.example.com/mx for all pages on my site. How would I go about that. Can I do that in Magento admin section?


texts: Magento Unknown column core_translate.string

texts:
In my Magento website i got an error about core_translate table in database and display like below :

a:5:{i:0;s:274:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'core_translate.string' in 'field list', query was: SELECT `core_translate`.`string`, `core_translate`.`translate` FROM `core_translate` WHERE (store_id IN (0 , :store_id)) AND (locale = :locale) ORDER BY `store_id` ASC";i:1;s:2863:"#0 example.com/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 example.com/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 example.com/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 example.com/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `core_tr...', Array)
#4 example.com/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `core_tr...', Array)
#5 example.com/lib/Zend/Db/Adapter/Abstract.php(811): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 example.com/app/code/core/Mage/Core/Model/Resource/Translate.php(79): Zend_Db_Adapter_Abstract->fetchPairs(Object(Varien_Db_Select), Array)
#7 example.com/app/code/core/Mage/Core/Model/Translate.php(289): Mage_Core_Model_Resource_Translate->getTranslationArray(NULL, 'en_US')
#8 example.com/app/code/core/Mage/Core/Model/Translate.php(142): Mage_Core_Model_Translate->_loadDbTranslation(false)
#9 example.com/app/code/core/Mage/Core/Model/App/Area.php(146): Mage_Core_Model_Translate->init('adminhtml')
#10 example.com/app/code/core/Mage/Core/Model/App/Area.php(121): Mage_Core_Model_App_Area->_initTranslate()
#11 example.com/app/code/core/Mage/Core/Model/App/Area.php(93): Mage_Core_Model_App_Area->_loadPart('translate')
#12 example.com/app/code/core/Mage/Core/Model/App.php(789): Mage_Core_Model_App_Area->load()
#13 example.com/app/code/core/Mage/Core/Controller/Varien/Action.php(512): Mage_Core_Model_App->loadArea('adminhtml')
#14 example.com/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#15 example.com/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#16 example.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#17 example.com/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 example.com/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#19 example.com/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#20 example.com/index.php(83): Mage::run('', 'store')
#21 {main}";s:3:"url";s:21:"/demo/index.php/admin";s:11:"script_name";s:15:"/demo/index.php";s:4:"skin";s:5:"admin";}

any suggestions about that error ?.


texts: hello everyone i am using magento 2.1 in my case i want to override a model class in  my custom module , but the override didn't toke correctly


texts: catalogProductAttributeMediaCreate() exception: Product does not exist

texts:
I'm uploading images to my Magento server using the v2 SOAP web services.

My PHP code is:

// Session and other stuff...
//

$file = fopen ( "magento_art.txt" , "r" );
$data = fgetcsv ( $file , 2048, "$", "\\");

while (( $data = fgets ( $file , 2048)) !== false) {

    $data = str_replace('º', '&deg', $data);
    $data = str_replace('"', '', $data);
    $data = str_getcsv( $data, "$");

    $path= 'fotos/'.$data[14];
    $type = pathinfo($path, PATHINFO_EXTENSION);
    $raw_image = file_get_contents($path);
    $base64 = base64_encode($raw_image);
    $image = array(
        'content' => $base64,
        'mime' => 'image/jpeg'
    );

    var_dump($image);
    echo "\n\n";

    try{
        print_r("SKU: ".$data[1]."\n\n");
        $result = $client->catalogProductAttributeMediaCreate(
            $session,
            (string)$data[1],
            array('file' => $image, 'label' => 'image', 'position' => '100', 'types' => ['image'], 'exclude' => 0)
        );
    }

    catch(Exception $e){
        echo "Exception: ".$e->getMessage()."\n\n";
    }

And every single time I get the exception 'product not exists'. I've checked myself that the product exists in my server and the SKU code is the same in my PHP script and in my server, but the API method is not working.

What can it be? I've tried also 'hard coding' a SKU of one of my products and that didn't work either.


texts: Magento 2 :Uber Theme Data Migration Tool Error

texts:
I want to migrate magento 1.9.2.2 data like customer,order,product,categories,attribute etc in Magento 2.2.2 And
for I have use https://github.com/ubertheme/module-ubdatamigration(data migration tool)

but its showing error after installing.

I have attached screen shot also.
please help for this error


texts: Magento 2: How to enable the gift card history in my account page?

texts:
In Magento 2 Commerce, we cannot see the customer's gift card history in Account page. We can only redeem and see the status of gift card by putting the gift card code.
How can I show the gift card history against customers?
Please guide


texts: How to fix "Connection to Redis failed" error?

texts:
I cannot open the site and can't run any commands. I'm getting the below error:

The thing is that I have configured our development site into local (Xampp). In the development site, we have used the redis cache. I think this is the reason why the error is throwing.

Can anyone please help me with this?


texts: Check which filters have been applied to a collection

texts:
Is it possible to check which filters have been applied to a given collection.

For example:

$collection = Mage::getModel('sales/order')->getCollection();
$collection->addFieldToFilter('state', 'processing');
$collection->addFieldToFilter('status', 'processing2');

I want to get an array of all filters applied at this point:

array(
    'state' => 'processing',
    'status' => 'processing2'
)

The closest i can get so far seems to be:

$collection->getSelect()->getPart('where');

But this is not exactly what I am looking for as it does also provide the AND etc.

For example:

array(2) {
    [0] => string(22) "(state = 'processing')"
    [1] => string(28) "AND (status = 'processing2')"
}


texts: bannerslider in magento2 admin not working for my local?

texts: I have installed bannerslider extension in my local ( in /htdocs/magento2/), but i am not getting in admin panel ,any one plz guide me for this problem ?


texts: Migrate local server database info to remote web server after adding language or storefront

texts:
I have a Magento local install for testing. How do I transfer my database changes after I add e.g. a new language.

I have added all the products texts etc pp, but I can't just dump the mysql database back because, it would delete all the orders made during my translation, what is the best modus operandi, in such case?


texts: Magento Custom option file download 404 page in order

texts:
After upgrade 1.9.2.4 to 1.9.3.3.
I have some issue regarding to order.
When I clicked custom option type file for download I got 404 page.

When I tried to print log related to file following code return in
app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php.
in _getOptionHtml($optionValue).

Array
(
    [type] => image/png
    [title] => Chimp logo vector WITHOUT R.png
    [quote_path] => /media/custom_options/quote/C/h/0d82ed5bd0ebc6ef699da24c5086ac49.png
    [order_path] => /media/custom_options/order/C/h/0d82ed5bd0ebc6ef699da24c5086ac49.png
    [fullpath] => /home/ddfgbbtgfbtttb/public_html/media/custom_options/quote/C/h/0d82ed5bd0ebc6ef699da24c5086ac49.png
    [size] => 47115
    [width] => 1438
    [height] => 809
    [secret_key] => 0d82ed5bd0ebc6ef699d
    [url] => Array
        (
            [route] => sales/download/downloadCustomOption
            [params] => Array
                (
                    [id] => 1999
                    [key] => 0d82ed5bd0ebc6ef699d
                )

        )

)

I also refer following links One
Two,
Any idea how to solve it ?


texts: StoreRepository get($code) which does not exists

texts:
Till today all the code was okay, but after code review, I got that we use the method

load() on the store itself so I replaced it with

storeRepository->get($code)

Code what I'm talking about first fetched by load() then created the new entity by factory if it wasn't found. Right now after replacement, a problem occurred - method get() in storeRepository injects itself StoreFactory to create new store if it's not found, the problem is it fetches it from config,

but is it standard core_config_data Config ? If so, what parameters I should write to that config and what arguments in method save() of configuration should be used?


texts: MiGS payment gateway is not appearing in Payment Methods section in One Page Checkout

texts:
I am using this MiGS Payment Gateway plugin. I input all fields in the plugin settings ( System > Configuration > Payment Methods > MIGS Payment Gateway ) and enabled the settings. I use One Page Checkout and disabled Multishipping.

However, after I pressed Checkout > Checkout as Guest > filled in basic information, address, shipping method. However, when I reached Step 5, it said:

  Your order cannot be completed at this time as there is no payment methods available for it.

What did I miss ? Anything I should provide for you guys to debug?

Using Magento 1.9.1

UPDATE I updated the info.phtml of app/design/frontend/{theme_name}/{package_name}/template/checkout/onepage/payment/ to have the following codes:

$payments = Mage::getSingleton('payment/config')->getActiveMethods();
$methods = array(array('value'=>'', 'label'=>Mage::helper('adminhtml')->__('--Please Select--')));
foreach ($payments as $paymentCode=>$paymentModel) {
    $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
    $methods[$paymentCode] = array(
        'label'   => $paymentTitle,
        'value' => $paymentCode,
    );
}
print_r($methods);

It successfully shows the MIGS as "Active methods". Why does One Page Checkout not available to show payment methods?

The output of the print_r() is as follow:

Array (
  [0] => Array ( [value] => [label] => --Please Select-- )
  [free] => Array ( [label] => No Payment Information Required [value] => free )
  [purchaseorder] => Array ( [label] => Purchase Order [value] => purchaseorder )
  [banktransfer] => Array ( [label] => Bank Transfer [value] => banktransfer )
  [cashondelivery] => Array ( [label] => Cash On Delivery [value] => cashondelivery )
  [hosted_pro] => Array ( [label] => Paid by Credit Card [value] => hosted_pro )
  [migsvpc_server] => Array ( [label] => MiGS [value] => migsvpc_server )
  [paypal_here] => Array ( [label] => Credit Card Payment [value] => paypal_here )
)

UPDATE I further found out that when I click "Next" in Shipping Method, the request to saveShippingMethod/ returns an error:

  Fatal error: Call to a member function getGiftMessageId() on a non-object in /path/to/magento/app/code/core/Mage/GiftMessage/Model/Observer.php on line 137


texts: Grand Total adds Tax when Products already include Taxes

texts:
Magento 2.3.4 / PHP 7.3

I've set my website tax rules in the following way:

Product prices in backoffice include Tax
Shipping prices also include tax

These are the TAX settings:

This is the product price in BO:

This means that the price is 5€ and I said in tax calculation that prices already include tax. But in frontend I see that the grand total adds the taxes (Grand Total should be 14.95, but it's 14.95 + 21% tax). What am I doing wrong? Why is it adding taxes when I said in tax calculation settings that prices already have taxes included?


texts: one category page views only 10 products

texts:
I've one category called x it has about 1700 active skus  while it only display 10 on front end

in public/app/code/core/Mage/Catalog/Block/Product/List.php :

  $this->_productCollection = $layer->getProductCollection();

has only 10 items.

also there is no observers for this event :

  catalog_product_collection_load_before

any suggestion how to fix ?

UPDATE :
all products are visible and there is no limit on adminhtml , other categories are working as expected


texts: Magento2: how to debug in sales_order_place_after event

texts:
registration.php

 <?php
    \Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Hafiz_Sms',
    __DIR__
    );

etc/events.xml

<?xml version="1.0"?>
<configxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<eventname="sales_order_place_after">
<observername="place_order_after" instance="Hafiz\Sms\Observer\Orderplaceafter" />
</event>
</config>

etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Hafiz_Sms" setup_version="2.1.1"></module>
</config>

Observer/Orderplaceafter.php

<?php
namespace Hafiz\Sms\Observer;
use Magento\Framework\Event\ObserverInterface;
use Psr\Log\LoggerInterface;
class Orderplaceafter implements ObserverInterface
{
protected $logger;
public function __construct(LoggerInterface$logger) {
$this->logger = $logger;
}
public function execute(\Magento\Framework\Event\Observer $observer){
  $order = $observer->getEvent()->getOrder();
  echo $orderId = $order->getId();
//  $comment = $this->getRequest()->getParam('comment');
  print_r("Catched event succssfully !"); exit;
}
}

But it's not working. How to debug in this event?. Kindly suggest me where i am wrong?


texts: Help! image appearing twice on product page

texts:
we have had our website developed with an offshore team located in India and it to see I would be putting it lightly if I said it has been frustrating.

I have no idea about coding and pretty much self taught when it comes to the magento admin side of things. We are using magento 1.9 which I hear is pretty old school... is that right?

Any how... when we create a new product and upload the product image it seems to duplicate. See image below. Is this something I can fix myself without having to code anything? can it be fixed in magento admin at all? Any help is much appreciated!

Thanks


texts: Magento 2 - Override a helper using plugin

texts:
What is the best practice to override a helper?

is it through Preference or Plugin?

And how can I override a helper using Plugin?


texts:
i've tried to do some curl post to my other services using built in magento curl.

i already did this for the curl request

        $this->curl->post($url, $data);

yeah it's work but my data is change to url encoded style. my question is there any ways for me change the style from url encoded to Json Body request?

thanks in advance


texts: Magento 2.2 - adding name field to newsletter module

texts: I'm using magento 2.2 and I want to add name field for newsletter module, so there has to be input box in front-end, and also it needs to show in backend, how to achieve this? There is a lot of posts about this, but they all are on older magento versions. So can someone explain how to achieve this?


texts: Magento2 export and import configurations instead of uploading the DB

texts:
Is it possible to move settings like product, customers and categories attributes, store settings and others that doesn't include data

product, customers, orders, categories, etc ...

Instead of having to move the DB from dev or testing


texts: How to run Magento 2 with pub as document root?

texts:
I have a nexcess hosting with document root /home/aae3re95/dev.example.com/html and i need to set /home/aae3re95/dev.example.com/html/pub as document web root.
Please tell me steps to make pub as document root.
Thanks


texts: Magento 2 "No such entity" debug when creating customer

texts:
I am creating an account which is recently developed in Magento 2.2.4 and migrated from Magento 1.9.1.0.

I am getting error "No such entity with email = rr@g.com, websiteId = 1"

I am not finding the way that how to know which empty is missing in my database.While I have already checked each tables manually which is responsible to create an account.

I wanna know is there any tool that help to know exactly what is missing in my DB.

My website is multi website.

While Debugging code in file

vendor/magento/module-customer/Model/AccountManagement.php

try {

            // If customer exists existing hash will be used by Repository
            $customer = $this->customerRepository->save($customer, $hash);
        } catch (AlreadyExistsException $e) {
            throw new InputMismatchException(
                __('A customer with the same email already exists in an associated website.')
            );
        } catch (LocalizedException $e) {
            throw $e;
        }

How to debug code after line

$customer = $this->customerRepository->save($customer, $hash);

while creating account every time its going to

} catch (LocalizedException $e) {
                throw $e;
            }

and produce error

  "No such entity with email = rr@g.com, websiteId = 1"

Is there any way we can through error what exactly is missing in my DB?

Thanks.


texts: Error in "System > Configuration" Admin Page on Magento

texts:
Fatal error: Call to undefined method Zend_Locale::getAlias() in app/code/core/Mage/Core/Model/Locale.php on line 243

This error appears when I try to open the tab System > Configuration but also appears on the dashboard.

I have looked at the code but doesn't have any idea of whats going on. Maybe a Location / Time Zone error.


texts: I want to change the position of the mini cart in my theme. i am able to change it using css but it disturbs the mobile view. So is there any way i can do it using xml


texts: No able to change English word "BAG" in the homepage menu

texts:
I've an e-commerce site in Magento 1.9 with two version: English and French.
I've to change some words in both English version and in the French.
For example, in the English version, I've to change word "BAG" shown in the following image:

I've to replace "BAG" with "SHOPPING BAG" but, inserting string "BAG", "SHOPPING BAG" (or "bag","shopping bag", or "Bag", "Shopping bag") into translate.csv of the theme (in the English folder) any change is shown in the frontend.
Activating path hints for the English version I notice that the phtml file that builds the block that contains this menu is the following:

<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle()?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<?php
    $currentUrl = Mage::helper('core/url')->getCurrentUrl();
    if (preg_match('/^https/', $currentUrl)) {
        $currentUrl = str_replace('https://', 'http://', $currentUrl);
    }

    $exclusions = array(
        'checkout/',
        'customer/account/'
    );
    $regexUrl = '/^' . str_replace(array('/', '.'), array('\\/', '\\.'), Mage::getBaseUrl() . '(?:(?:' . implode(')|(?:', $exclusions) . '))') . '/';
    if (!preg_match($regexUrl, $currentUrl)) {
        echo '<link rel="canonical" href="' . $currentUrl . '" />';
    }
?>
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
    var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
    var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->

<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->getIncludes() ?>

I think that there are some function (may be getHtmlChild()) that overwrites my translation because other words are translated adding new strings into traslate.csv.

Which file or function I've to change to see "shopping bag" in the frontend of my site? Why some words are changed with translate.csv and others not?
Can you help me, please?
Thank you very much!


texts: product_attribute_media.list gives Product not exists error in Magento

texts:
According to magento, this is the parameter list for the SOAP (v1) product_attribute_media.list call:

http://www.magentocommerce.com/api/soap/catalog/catalogProductAttributeMedia/catalog_product_attribute_media.list.html

I have a numeric sku (e.g. 123456). So, when I call this api method, I get Product not exists. soap fault.

This is my code:

// Load existing images
$existingImages = $proxy->call(
    $sessionId,
    'catalog_product_attribute_media.list',
    (string)$SKU,
    $storeId,
    'sku'
);

Any ideas why this isn't working?

Before you ask; yes this product in $SKU (e.g. 123456) does exists in magento at the specified store id, I have already checked.


texts: Magento 2 The information or error messages always remain displayed even after a change of page

texts: The information or error messages always remain displayed even after a change of page, so once I get to the cart I have 5 or 6 messages that are still present, how to put a lifetime to the messages in magento 2


texts: Quick script to prewarm cache using sitemap.xml

texts:
I was wondering if there is a small (nightly optimization) script out there that can

clean all cache, including fpc
(https://github.com/GordonLesti/Lesti_Fpc) [check]
open the sitemap of corresponding store [check]
visit every link in there (to warm
cache and FPC) [check, taken from W3 TC]

Pref. all from 1 script. And with the ability to run it *per domain, or *loop through all store views. I found this: Pre-Warming the Magento Enterprise Full Page Cache & other snippets.

ps. We know caching != performance and would really appreciate you help

Thanks, Sean

(added working code to my own question haha - took me 3 hours but here you go)


texts:
I have created one recurring profile product & using paypal as payment gateway.
After clicking on payment I got the error as

  "PayPal gateway has rejected request. Payment has already been made
  for this InvoiceID (#10412: Duplicate invoice)."

I have done the required settings in my paypal account. PayPal Account (standard) > Profile > Payment Receiving Preferences > Under Block accidental payments: select No, allow multiple payments per invoice ID.

But still it is giving me the same error.

Any suggestion will help a lot.


texts: Magento 2: Cache is not clearing. (All steps taken)

texts:
Changes on my site aren't showing up unless I load a previously unloaded product.

  I've tried removing pub/static admin and frontend

  I removed generated,
  var/cache, and var/view_preprocessed

I cleaned and flushed the cache, used all 3 of the cache cleaning buttons in the lower corner (images, js, etc)

When I change something on the homepage (like the header type (porto theme))), it doesn't show up. It'll show up on a product I haven't opened before, but not the homepage or previously loaded products.

I ran

setup:upgrade, setup:di:compile, setup:statid-content:deploy -f

and I even tried reinstalling the theme and patches! No luck, even in private browsing with cookies cleared.

I tried restarting my server (cloudways) and that did it once, but only once.
I also keep getting console errors about require not being a function, but those come and go

I'm out of ideas. Is there anything I haven't tried yet?

Thanks


texts: How to check uniquenes of color options when adding a color magento 2?

texts: I want that when i add an  existing color an exception will be raised so how to proceed and which file do i have to override and thanks in advance.


texts: Magento 2 : How to Add Custom Input Field in Customer Registration Form

texts: I want to add an extra field on the customer registration form and its value must be saved in database after its subimission. How can I do that?


texts:
I perform Export Products from one Magento 2 Store and Import that CSV file in another Magento 2 Store. I am facing some issues like below.

Category list is displaying below

Product image is not displaying

I entered into both Admin Panel and found like below

I ran below commands after Import

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


texts:
Is it possible to get the order state history of an order? I'm able to get the statuses using sales/order_status_history model.

$orderHistory = Mage::getModel('sales/order_status_history')->getCollection()
                ->addFieldToFilter('parent_id', $order->getId());

This only brings back the order status and comment (and a few other bits).

Is there any way I can get the state the order was in for each status? I can't see it stored anywhere other than in the order table but that's the current state.

Thanks in advance.


texts: Customer account is temporarily disabled magento

texts:
I am trying to call customer login api.

{{url}}/index.php/rest/V1/integration/customer/token

with body

{
    "username" : "xxxxx@gmail.com",
    "password" : "fsfsdf"
}

I am  getting an  error

"You did not sign in correctly or your account is temporarily disabled."

But i am able to login through magento website.This error is getting only for particular email ids.Please help me


texts:
I have website where all links http://example.com/PRODUCTPAGE redirect to http://www.example.com

It´s always missing the path after the domain name in my case the productpage.

I know this is partly SEO wise but I´m wondering besides the SEO effect if changing this in my .htaccess would have any effect on other functionality from Magento?

If needed I can paste my .htacess but I have not changed anything really and I´m mostly wondering what would change.


texts: magento 2 don't want to show proceed to checkout button based on custom condition

texts:
How to hide Proceed to Checkout button in the mini cart section magneto 2 from custom module based on my condition.

For example:
                   if the custom session data is set then hide - Proceed To Checkout
                   if the custom session data is not set then show - Proceed To Checkout


texts: Add input type file in html template using knockoutjs

texts:
I have created custom module in which I have created front-end template form using knockout js.

I want to add input-type file . I want to save file in folder and store it's name in database on form submit ,

please help me if anyone has did this ?


texts: Is dependency injection possible for plugins?

texts:
I'm trying to make a plugin to extend the \Magento\SalesRule\Model\Validator

Which works like a charm, but the problem is I need to make use of Magento\SalesRule\Model\RuleFactory

I've tried making a __constructor in the plugin class and adding the RuleFactory there through dependency injection as described in het Magento 2 Developer Guide which looked like this:

The entire "Validator" plugin class now looks like this:

class Validator{
    /**
     * @var \Magento\SalesRule\Model\RuleFactory
     */
    private $ruleFactory;

    /**
    * @param \Magento\SalesRule\Model\RuleFactory $ruleFactory
     */
    public function __constructor(\Magento\SalesRule\Model\RuleFactory $ruleFactory){
        $this->ruleFactory = $ruleFactory;
        error_log('validator constructed');
    }

    public function aroundInit(\Magento\SalesRule\Model\Validator $subject, $procede, $websiteId, $customerGroupId, $couponCode){
        //custom before code
        $return = $proceed($websiteId, $customerGroupId, $couponCode);
        //custom after code
        return $return;
    }
}

but this would just return null for $this->ruleFactory at all times.

the di.xml document contains the following:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <type name="\Magento\SalesRule\Model\Validator">
        <plugin name="ValidatorPlugin" type="\MAS\CouponAttempt\Model\SalesRule\Validator" sortOrder="1" disabled="false"/>
    </type>
    <type name="\MAS\CouponAttempt\Model\SalesRule\Validator">
        <arguments>
            <argument name="ruleFactoryInjection" xsi:type="object">Magento\SalesRule\Model\RuleFactory</argument>
        </arguments>
    </type>
</config>

Interestingly enough I found that in the generated Interceptor.php file the constructor is actually made. But it is never called, can anybody tell me why this could be?


texts: Custom block duplicating Product View using local.xml

texts:
I'm trying to add a new block to the Product View page using my local.xml file, within this file I have the following:

<catalog_product_view translate="label">
    <reference name="content">
        <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
            <block type="underlay_products/carpets" name="catalog.product.carpet_underlay" as="carpet_underlay" template="catalog/product/views/partials/carpet_underlay.phtml"/>
        </block>
    </reference>
</catalog_product_view>

Which adds the block, but it's in the wrong place and duplicates the product view page (there's 2 images, 2 product names, etc) and my block is at the bottom when it should be in a different place.

However, if I add this line to my catalog.xml file underneath the related_products block it works absolutely fine, the content is in the right place and there's no duplication of the product:

 <block type="underlay_products/carpets" name="catalog.product.carpet_underlay" as="carpet_underlay" template="catalog/product/views/partials/carpet_underlay.phtml"/>

Any ideas why this happens and I can use my local.xml file instead?


texts: how to print a list of available blocks from a template?

texts:
I am trying to find an existing block to call it from my template

is it possible to use something like:

    <?php var_dump( $this->getLayout()->getAllBlocks() );?>

this gives me a 505 error


texts:
I have submitted one module in Magento Marketplace. They gave me 2 errors in my code.

  Use of echo language construct is discouraged.

  Use of exit language construct is discouraged.

For echo, I have added /* @noEscape */ before echo.

But for exit, I don't know, how to solve error.

Code piece from Observer.php

           if ($maintenancePageBody != '') {
                if ($redirectPage == 0) {
                    /* @noEscape */ echo $blankpageMsg;
                } else if ($redirectPage == 1) {
                    /* @noEscape */ echo $maintenancePage;
                } else if ($redirectPage == 2 && $customUrl != '') {
                    header('Location:' . $customUrl);
                    exit;
                } else {
                    /* @noEscape */ echo $maintenancePage;
                }
            }
           // exit; /* my code */
           $this->getResponse()->setBody(); // I used this line instead of `exit`

Magento Marketplace error is,

  Use of exit language construct is discouraged.

  File: Model/Observer.php Line: 717 Column: 17 Source:
  MEQP1.Security.LanguageConstruct.ExitUsage

EDIT

I submitted extension again.
echo error still occurs. $maintenancePage variable has HTML content.

Would anyone please help me, what should I do for echo and exit ?


texts: Magento 2: How to add a class of style to body tag?

texts:
Magento version: 2.0.0

How to add a class of style into  tag?
I think it is added in the xml, right?


texts: Set Length, Width, Height OOTB Attributes Using API

texts:
Currently I can only change weight using api not Length, Width and Height. these are out of the box attributes in magento 2.3 as seen in the product panel below.

Price and weight is updated by POST to "http://www.hostname.com/rest/V1/products"

POST body contains:

{
"product": {
    "sku": "ProductSKU",
    "price": 99.99,
    "weight": 10,
    "extensionAttributes": {
        "stockItem": {
            "qty": 4,
            "isInStock": true
        }
    }
},
"saveOptions": true

}

This works perfectly for changing the price and weight. What line can I add to change the built in Length, Width and Height attributes?


texts: Images displaying issue on live server though working on local

texts:
Product images are not displaying on live site though they are displaying on my local system. How can I solve this?

Magento: 1.9.2


texts:
How to recode page cms to show 2 column of 6 product instead of one column of 6 product

this is my current coding

{{block type="catalog/product_new" template="catalog/product/new.phtml" product_count=''99" pagination="1" centered="1" hide_button="1" block_name="New in Store"}}

{{block type="ultimo/product_list_featured" template="catalog/product/list_featured_slider.phtml" category_id="28" product_count="99" breakpoints="[0, 1], [320, 2], [480, 3], [768, 4], [960, 5], [1280, 6]" pagination="1" centered="1" hide_button="1" block_name="Our Featured Products"}}


texts: Custom video banner in homepage in Magento 2.2

texts: How do I create a custom video banner on the homepage in Magento 2.2?


texts: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

texts:
Before Posting this question i read all duplicate question which is suggested by stack, un fortunately no previous question helped me.

What i did

Disable all module one by one ( except the default ones)
Drop database and import backup database
Deleted var folder ( new var folder is created so no permission issues i think still i give 755)

4.Re-Index is up to date and cache are disabled ,compilation is disabled as well


texts: Magento 2 - On opening CMS page its showing error "This page isn’t working"

texts:
I have Magento 2.3.4 installed on my website and when i try to edit CMS pages then its showing following error in the browser

and in the error log its showing following error

2020/06/12 07:50:43 [error] 23854#23854: *716139 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Return value of Magento\Cms\Model\Page\DataProvider::findCurrentPage() must be an instance of Magento\Cms\Model\Page or null, instance of Magento\Framework\View\Element\UiComponent\DataProvider\Document returned in /mnt1/public_html/www.example.com/public/vendor/magento/module-cms/Model/Page/DataProvider.php:104
Stack trace:
#0 /mnt1/public_html/www.example.com/public/vendor/magento/module-cms/Model/Page/DataProvider.php(189): Magento\Cms\Model\Page\DataProvider->findCurrentPage()
#1 /mnt1/public_html/www.example.com/public/generated/code/Magento/Cms/Model/Page/DataProvider/Interceptor.php(50): Magento\Cms\Model\Page\DataProvider->getMeta()
#2 /mnt1/public_html/www.example.com/public/vendor/magento/framework/View/Element/UiComponentFactory.php(318): Magento\Cms\Model\Page\DataProvider\Interceptor->getMeta()
#3 /mnt1/public_html/www.example.com/public/vendor/magento/framework/View/Element/UiComponentFactory.php(218): Magento\Framework\View\Elemen" while reading response header from upstream, client: 10.2.2.149, server: www.example.com, request: "GET /moonwalkr_se09sg15/cms/page/edit/page_id/2/key/4fa3fda227923d9a102dafac187871fa0cdff9c64e473ad61f7d06ae94bac43b/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "www.example.com"

Any help. how to resolve this issue?


texts: Foreign key constraint is incorrectly formed after upgrade to 2.3.0

texts:
Please help!!!!!! I am upgrading from 2.1.7 to ver 2.3.0 I am stuck. I am not sure how no one else has the same issue. nothing related to this table on any forum. I am unable to Truncate, Delete this table due Foreign key constraint. I tried to delete the customer_group table i get this ("Cannot delete or update a parent row: a foreign key constraint fails")
when I Truncate I get this message ("Cannot truncate a table referenced in a foreign key constraint (aayebmfmry.catalog_product_bundle_price_index, CONSTRAINT catalog_product_bundle_price_index_ibfk_1 FOREIGN KEY (customer_group_id) REFERENCES aayebmfmry.customer_group (`customer_"

luckily this is a staging environment, so I have done upgrade couple times and I cannot get past this nightmare table.

after removing some old modules and updating it to php 7.1 - the upgrades goes smoothly and the next step is (php bin/magento setup:upgrade)
This is the message i get....

Foreign key constraint is incorrectly formed), query was: ALTER TABLE customer_group MODIFY COLUMN customer_group_id int(10) UNSIGNED NOT NULL  AUTO_INCREMENT

This option doesnt really work...no table are effected when i run this query

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table customer_group;
SET FOREIGN_KEY_CHECKS = 1;


texts: I would like to show the Brand attribute under the product name on the listing page. Attached is a screenshot for reference.


texts:
Qty on the database tables cataloginventory_stock and cataloginventory_stock_item are different from Magento admin page.
I'm assuming there is a problem to load qty from the database.

I want to know how to load qty information from database to Magento admin page.

Thank you


texts: Different discount for category products

texts:
I want to know is there a way to get different discount for the products in the same category if quantity exceeds a limit.

For example:
I have these products with these prices:

A=10
B=15
C=12

And if I choose more than 6 in any combination of these the prices would be:

A=7
B=13
C=11

So if I choose 4xA, 1xB and 1xC the total would be: 52 but if I choose 2xA, 2xB, 2xC the total would be: 62


texts:
I've created my uninstall class/script.

After installing my sample module using composer I can see the module working.

Then, I try to uninstall the module using:

bin/magento module:uninstall Barbanet_SampleModule

And I see this message:

You are about to remove code and/or database tables. Are you sure?[y/N]y

Enabling maintenance mode

You are about to remove a module(s) that might have database data. Do you want to remove the data from database?[y/N]y

You are removing data without a database backup.
Removing data of Barbanet_SampleModule
Removing Barbanet_SampleModule from module registry in database
Removing Barbanet_SampleModule from module list in deployment configuration
Removing code from Magento codebase:

Then I press enter a few times I got this message:

Command "remove" failed: Loading composer repositories with package information
    Authentication required (repo.magento.com):
      Username:       Password:

  [Composer\Downloader\TransportException]
  Invalid credentials for 'https://repo.magento.com/packages.json', aborting.

remove [--dev] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [packages1] ... [packagesN]

Please disable maintenance mode after you resolved above issues.

My module was removed from composer.json, also was deleted from the steup_module table and also the custom table was deleted from the database.

My composer keys are stored at my personal auth.json file too.

Someone knows why I'm getting this message and why the uninstall process isn't finishing correctly.


texts: Remove SKU Column from Transactional Emails

texts:
I would like to know how to remove the SKU column from transactional emails my store sends.

The email template contains {{var order.shipping_description}} but I don't know where this block is pulled from.

At least I assume that's what's rendering the table of info displayed in the following image:


texts: move selectionsColumn in magento 2 to the left of admin grid

texts:
I have added selectionsColumn in admingrid but it appear in the right of the table. I want to move it to left of the table. how can I do that? Here is column section of my listing.xml
<!-- Column -->
  <columns name="lern_carrier_columns">
    <selectionsColumn name="ids">
      <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
          <item name="indexField" xsi:type="string">carrier_id</item>
        </item>
      </argument>
    </selectionsColumn>
    <column name="carrier_id">
      <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
          <item name="filter" xsi:type="string">textRange</item>
          <item name="sorting" xsi:type="string">asc</item>
          <item name="label" xsi:type="string" translate="true">ID</item>
        </item>
      </argument>
    </column>
    <column name="name">
      <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">Name</item>
        </item>
      </argument>
    </column>
  </columns>


texts:
Running 1.9.x Magento, I found a handful of products (out of 80k) that have a product attribute value that cannot be edited from the product edit panel.

The attribute value is a custom value called 'runtime', and when I edit the value and hit save,it gives a product saved success msg, but then shows the value same value as before.

When I error log on $productModel->getData() just before save(), I see attribute listed in the data with the correct value, but I see that same attribute with the original value listed under mage_catalogInventory_model_stock_item object in [_defaultValues:protected]. I also see another attribute in that same default Values array, and that attribute is also not editable.

These two attributes exist on almost all of my 80k products, and I am not experiencing this issue on any of the other products I spot checked. The attributes are 'text' type, and the value I'm trying to save is between 3 characters long.

When I manually connect to the db, I can edit the values no problem.

I also only see one entry for this attribute_id and enttity_id in catalog_product_entity_text with a storecode of 0

I have googled this issue to death, and am not getting anywhere.
The piece of debug I'm focusing on is below:

[stock_item] => Mage_CatalogInventory_Model_Stock_Item Object
    (
        [_minSaleQtyCache:Mage_CatalogInventory_Model_Stock_Item:private] => Array
            (
            )

        [_qtyIncrements:protected] =>
        [_eventPrefix:protected] => cataloginventory_stock_item
        [_eventObject:protected] => item
        [_productInstance:protected] => Mage_Catalog_Model_Product Object
            (
                [_cacheTag:protected] => catalog_product
                [_eventPrefix:protected] => catalog_product
                [_eventObject:protected] => product
                [_canAffectOptions:protected] =>
                [_typeInstance:protected] =>
                [_typeInstanceSingleton:protected] =>
                [_linkInstance:protected] =>
                [_customOptions:protected] => Array
                    (
                    )

                [_urlModel:protected] =>
                [_errors:protected] => Array
                    (
                    )

                [_optionInstance:protected] =>
                [_options:protected] => Array
                    (
                    )

                [_reservedAttributes:protected] =>
                [_isDuplicable:protected] => 1
                [_calculatePrice:protected] => 1
                [_defaultValues:protected] => Array
                    (
                        [display_string] => test string value
                        [runtime] => 10.32
                    )

Anyone have any suggestions?


texts: What is override preference, block, model and preference?

texts:
I want to edit Magento 2 core function:

 /**
     * Build category URL path
     *
     * @param \Magento\Catalog\Api\Data\CategoryInterface|\Magento\Framework\Model\AbstractModel $category
     * @return string
     */
    public function getUrlPath($category)
    {
        if (in_array($category->getParentId(), [Category::ROOT_CATEGORY_ID, Category::TREE_ROOT_ID])) {
            return '';
        }
        $path = $category->getUrlPath();
        if ($path !== null && !$category->dataHasChangedFor('url_key') && !$category->dataHasChangedFor('parent_id')) {
            return $path;
        }
        $path = $category->getUrlKey();
        if ($path === false) {
            return $category->getUrlPath();
        }
        if ($this->isNeedToGenerateUrlPathForParent($category)) {
            $parentPath = $this->getUrlPath(
                $this->categoryRepository->get($category->getParentId(), $category->getStoreId())
            );
            $path = $parentPath === '' ? $path : $parentPath . '/' . $path;
        }
        return $path;
    }

I am new to Magento 2 and I want to edit the aforementioned code. The problem is that, after I edit the core file and later on when Magento executes an update, my edited codes will be reset.

I searched on Google and found out that we can create plugins to edit these core functions, But I am getting confused. I can't find simple tutorials or reference about how to do it.

There are some answers on Stackexchange, which says to Add override preference in di.xml, then create Create block,model and controller file in your module. I am not able to understand these procedures? Can anyone please explain what is block,model and controller? please How should I use it with the above function.

Kindly guide me with the same. Any help will be appreciated.

Thank You


texts: Magento2 : Add to cart is not working on enable FPC

texts:
On my magento2 store add to cart is not working when enabling FPC.
/Checkout/cart/add ajax returning 302 error on click on add to cart button -

When FPC disable then all works fine, /checkout/cart/add ajax return 200.
What should I do?


texts: Magento 2.1:- To get all list of shipping carrier (Method)?

texts:
I have created admin form. I want to get shipping carrier list in admin form. How can get it? Like this below image.

Please give me proper suggestion.


texts: Magento 2 does not read my requirejs-config.js

texts:
I'm customizing customer address tab in Admin Panel. Here is my code. It's reading my files but 'Add New Addresses' button is not responding.

my code is:

app/code/Learning/Helloworld/view/adminhtml/requirejs-config.js

/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            'Magento_Ui/js/form/components/collection':'Learning_Helloworld/js/form/components/collection'
        }
    }
};

app/code/Learning/Helloworld/view/adminhtml/web/js/form/components/collection.js

/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
define([
    'underscore',
    'mageUtils',
    'uiRegistry',
    'uiComponent',
    'uiLayout',
    'Magento_Ui/js/modal/confirm'
], function (_, utils, registry, Component, layout, confirm) {
    'use strict';

    var childTemplate = {
        parent: '${ $.$data.name }',
        name: '${ $.$data.childIndex }',
        dataScope: '${ $.name }',
        nodeTemplate: '${ $.$data.name }.${ $.$data.itemTemplate }'
    };

    return Component.extend({
        defaults: {
            lastIndex: 0,
            template: 'Learning_Helloworld/form/components/collection'
        },
..........................
    });
});

app/code/Learning/Helloworld/view/adminhtml/web/template/form/components/collection.html

Magento 2

                <button class="action-delete" type="button" data-bind="click: $parent.removeAddress.bind($parent, element)">

                </button>

            <button data-bind="click: element.addChild" type="button" class="scalable add">

            </button>

            <fieldset class="admin__fieldset">
                <legend class="admin__legend">

                </legend>

            </fieldset>

After I have ran below commands

php bin/magento cache:clean

php bin/magento cache:flush

php bin/magento setup:static-content:deploy

'Add New Addresses' button is not responding in 'Addresses' tab. Where went wrong?


texts: Performing Magento CRUD operations when user clicks radio button

texts:
Hello Everyone

I am new to Magento and have been having trouble performing basic CRUD
operations , specifically Update..

The Scenario

There are two radio buttons (ON, OFF) when a user clicks the off button
it he should be moved to the General customer group in the db
Likewise when the  user clicks ON he should be moved to the Auto customer group in the db

NOTE:  these operations need to happen on the user click

The Code
view.phtml located /magento/app/design/frontend/default/MAGXXXXX/template/autorefill

<form action="???" method="post">
    <input type="radio" name="auto-refill" value="On" onClick = "<?php echo Mage::getUrl('test/index/save') ?>" />On<br>
    <input type="radio" name="auto-refill" value="Off" onClick = "???" />Off
</form>

AutoFillUpdate.php located /magento/app/code/local/AppName/AutoFillUpdate/Model

<?php

class AppName_AutoFillUpdate  {
} ?>

IndexController.php located in /magento/app/code/local/Custom123Recycle/AutoFillUpdate/controllers

<?php
class Custom123Recycle_AutoFillUpdate extends Mage_Core_Controller_Front_Action
{

  public function indexAction()
   {
      //TODO
   }

  public function saveAction()
  {
    //Might be where update customer group should happen

   $customer = Mage::getSingleton('customer/session')->getCustomer();
   $groupId = $customer->getGroupId();
   $group = Mage::getModel('customer/group')->load($groupId);
   $groupCode = $group->getCode();

 if (groupCode == 'General')
    $customer.setGroupId(2).save();
 else
  $customer.setGroupId(1).save();

  }

}
?>

What I Know

I was told in order to manipulate the db I would need
to create a new module which I have done its called AutoFillUpdate
which resides in /magento/app/code/local/AppName/AutoFillUpdate

Inside this folder is are the basic Magento folders (Block, Helper, Model, controllers, etc, sql)

Points of Confusion

I am interested in updating the customer DB..so I would think I would be okay getting the module using Mage:getModel('customer/session') and then just updating that specific customer if they click the button, Why would I need to create a new module if the customer that has the db resides in core ? OR am I mistaken..

I am confused on how to my created module links with the view.phtml template

Questions
What value/string should go in the form action & onClick elements in view.phtml

Should the update functionality happen inside the controller indexController.php?

Would implementing listeners be more suitable ?

Any guidance of any complexity is welcomed, Thanks in advance


texts:
I upload my previous magento store on new server.then import database on new server.then delete local.xml file, then when I run my url for magento installation ,url gives me 404 error.

Any one help me for that.

Magento Version:1.9.3.4


texts: How to disable autocomplete off for only street address while entering new shipping address in magento 2

texts: How to disable only for street address lines at the checkout page in Magento 2


texts: How to send post data with redirect from magento 2?

texts: How we can set post data and send it to third party with redirection in Magento2?


texts: Magento 2 - How to add the DateTime UI Component

texts:
I want to add new field as datetime in CMS page section while adding new page, I found that magento using UI Component for it, so after digging I could able to add the date field by using below code but not able to add datetime field. Can anybody help on it.

Code for add date field:

<field name="start_date">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">string</item>
            <item name="label" xsi:type="string" translate="true">Go Live Start Date</item>
            <item name="formElement" xsi:type="string">date</item>
            <item name="source" xsi:type="string">page</item>
            <item name="sortOrder" xsi:type="number">21</item>
            <item name="dataScope" xsi:type="string">start_date</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>

File we need to override to achieve:

vendor/magento/module-cms/view/adminhtml/ui_component/cms_block_form.xml


texts: 403 Forbidden on specific promo form POST contents

texts:
I'm getting 403 Forbidden responses when attempting to save changes to an existing shopping cart price rule. It only occurs under the following condition:

Adding more than 3 conditions to the rule

For context, I'm trying to add 5 conditions to the rule, all of them structured as:

ANY = TRUE:
  IF FOUND WITH ANY = TRUE:
    SKU = X
    SKU = X
    SKU = X

If I try to add a fourth SKU = X condition and save the rule, I get a 403 forbidden error.

What I know:

This can only be re-produced on production (not dev/staging)
I can successfully set 3 or less SKU = X conditions with any values
I can successfully add any other types of conditions with any values
This occurs before preDispatch, so no redirects/forwarding is involved
The /.htaccess file is essentially stock (no rewrites)

Anybody experience this or something similar before?


texts: Use default value product view backoffice magento

texts:
I have a problem in magento 1.7 when I'm trying to check the "use default value" on a product attribute.

I would like to check  programmaticaly the checkbox "use default value" when the global special_price is the same as the specific store special_price.

My problem is all "global values" going to be empty when I used my script.

Thanks you if somebody can help me.

Cordially.

Here my script :

     $oGlobalProduct = Mage::getModel('catalog/product')->setStoreId(0)->load($iProductId);
        $oProduct = $oProductModel->setStoreId($iStoreId)->load($iProductId);
         //standard price is a custom attribute
        if($oGlobalProduct->getSpecialPrice() == $oProduct->getStandardPrice())
        {
             $setId = $oProduct->getAttributeSetId();

            $aAttribute = array();

            if ($setId)
            {
    // get all attribute group of the product
                $groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection')
                    ->setAttributeSetFilter($setId)
                    ->setSortOrder()
                    ->load();

                foreach ($groupCollection as $group)
                {
                    $attributes = $oProduct->getAttributes($group->getId(), true);

                    foreach ($attributes as $key => $attribute)
                    {
                        if (!$attribute->getIsVisible())
                        {
                            unset($attributes[$key]);
                        }
                        else {
                            $aAttribute[$attribute->getId()] = array(
                                'attribute_code' => $attribute->getAttributeCode(),
                                'use_default' => $oProduct->getExistsStoreValueFlag($attribute->getAttributeCode()),
                                'global_value' => $oGlobalProduct->getData($attribute->getAttributeCode()),
                                'store_value' => $oProduct->getData($attribute->getAttributeCode())
                            );
                        }
                        try{

                            if($aAttribute[$attribute->getId()]['global_value'] == $aAttribute[$attribute->getId()]['store_value'])
                            {
                                $oProduct->setStoreId($iStoreId)
                                    ->setData($attribute->getAttributeCode(), false);
                            }
                        }
                        catch (Exception $e)
                        {
                            echo $e->getMessage();
                            continue;
                        }
                    }
                }
                $oProduct->save();
            }
        }

Product view before the script (global) :

Product view before the script (store) :

Product view after the script (global)

Product view after the script (store)


texts:
I'm seeing about 70ish products that have a creation date that is in the future. These products were imported through CSV, so maybe the date field in the import was incorrect?

Has anyone experienced something like this before, and does it have any affect on the products?

Is there any way to change the product creation date other than editing it in the database?


texts: Can I display a sortable list of products with their attributes per category?

texts: Is it possible to show category products in a sortable list grid like this: http://www.mckenziesp.com/Black-Bear-McKenzie-C3453.aspx


texts: Magento 2: Product disappeared from frontend when I try to edit it

texts:
I am facing much trouble issue in Magento 2.

I edited a bundle product and assign some simple product to it, product disappeared from frontend and only shows product image in detail page.

I have also assigned that bundle product to a specific category but when I try to access category page, it shows "There are no product matching the selection".

I have reindex the website again and again but no solution.

I don't know what is causing this issue. Can somebody help?


texts: Magento 2: Continuously increasing system.log file with logging warning “main.WARNING: No such entity with addressId =”

texts:
I have facing issue in the system.log file to bulk up in GBs within couple of minutes. Upon in depth check, I found that Magento was logging warning “main.WARNING: No such entity with addressId =”.
I am using Magento ver. 2.2.4
Below is the system.log file which is the continuously logging warning.
system.log

main.WARNING: No such entity with addressId =
0 /vhosts/www.mywebsite.com/webroot/vendor/magento/module-customer/Model/AddressRegistry.php(49):
Magento\Framework\Exception\NoSuchEntityException::singleField('addressId',
NULL)
1 /vhosts/www.mywebsite.com/webroot/vendor/magento/module-customer/Model/ResourceModel/AddressRepository.php(166):
Magento\Customer\Model\AddressRegistry->retrieve(NULL)
2 /vhosts/www.mywebsite.com/webroot/vendor/vertex/module-tax/Model/AddressDeterminer.php(88):
Magento\Customer\Model\ResourceModel\AddressRepository->getById(NULL)
3 /vhosts/www.mywebsite.com/webroot/vendor/vertex/module-tax/Model/AddressDeterminer.php(67):
Vertex\Tax\Model\AddressDeterminer->getDefaultBilling('13366')
4 /vhosts/www.mywebsite.com/webroot/vendor/vertex/module-tax/Model/VertexUsageDeterminer.php(61):
Vertex\Tax\Model\AddressDeterminer->determineAddress(Object(Magento\Customer\Model\Data\Address),
'13366', true)
5 /vhosts/www.mywebsite.com/webroot/vendor/vertex/module-tax/Model/Plugin/TaxCalculationPlugin.php(132):
Vertex\Tax\Model\VertexUsageDeterminer->shouldUseVertex('1',
Object(Magento\Customer\Model\Data\Address), '13366', true)
6 /vhosts/www.mywebsite.com/webroot/vendor/vertex/module-tax/Model/Plugin/TaxCalculationPlugin.php(65):
Vertex\Tax\Model\Plugin\TaxCalculationPlugin->useVertex(Object(Magento\Tax\Model\Sales\Quote\QuoteDetails),
'1', true)
7 /vhosts/www.mywebsite.com/webroot/vendor/magento/framework/Interception/Interceptor.php(135):
Vertex\Tax\Model\Plugin\TaxCalculationPlugin->aroundCalculateTax(Object(Magento\Tax\Model\TaxCalculation\Interceptor),
Object(Closure), Object(Magento\Tax\Model\Sales\Quote\QuoteDetails),
'1')
8 /vhosts/www.mywebsite.com/webroot/vendor/magento/framework/Interception/Interceptor.php(153):
Magento\Tax\Model\TaxCalculation\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Tax\Model\Sales\Quote\QuoteDetails),
'1')

Any help will appreciate. Thanks.


texts:
On checkout ( billing page ) i want to add a condition like:
"if (something) { save billing info } else { save and go to next step}"

i tried to edit file opcheckout.js:

var Billing = Class.create();Billing.prototype = {
initialize: function(form, addressUrl, saveUrl){
    this.form = form;
    if ($(this.form)) {
        $(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
    }
    this.addressUrl = addressUrl;
    this.saveUrl = saveUrl;
    this.onAddressLoad = this.fillForm.bindAsEventListener(this);
    this.onSave = this.nextStep.bindAsEventListener(this);
    this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
},
save: function(){
    if (checkout.loadWaiting!=false) return;

    var validator = new Validation(this.form);
    if (validator.validate()) {
        checkout.setLoadWaiting('billing');

        var request = new Ajax.Request(
            this.saveUrl,
            {
                method: 'post',
                onComplete: this.onComplete,
                onSuccess:  this.onSave  ,
                onFailure: checkout.ajaxFailure.bind(checkout),
                parameters: Form.serialize(this.form)
            }
        );
    }
},

I tried to change " this.onSave " to "function(){ if(true) { this.onSave; }  }" to try if i can add a condition but after this change its not working - its not going to next step, i don't understand why


texts: How to increase custom attribute's text field limit

texts:
I have a custom product attribute with input type "Text Field" .So generally magento is allowing to enter maximum 255 characters into this.

Now my query is,I don't want to limit characters into text fields. Admin can enter more then 255 characters in this custom attribute.


texts:
After changing price Rs.31078 how to add it to the cart.

How to get the price dynamically?

$quote = $observer->getEvent()->getQuote();
            $item = $observer->getQuoteItem();
            $product_id=$item->getProductId();
            $_product=Mage::getModel('catalog/product')->load($product_id);
            // echo"<pre>";
            // print_r($_product);
            // exit();
            $newprice=$_product->getPrice();-->i need 31078  product change price.

            // ****** But in cart i am getting 15128. ? ******

            // Set the custom price
            $item->setCustomPrice($newprice);
            $item->setOriginalCustomPrice($newprice);
            $item->setFinalPrice($newprice);
            // Enable super mode on the product.
            $item->getProduct()->setIsSuperMode(true);

this is the change price ,i need to add to cart .
But in my cart its taking  admin panel product price


texts: Magento 2, List of configurable products with attribute options & add to cart

texts:
Scenario:

I have a requirement to show a list of products, where a customer can quickly add them to the basket. This list can contain simple or configurable products, and if a configurable is listed, it must provide all the options required to add right to the basket without redirecting to the details page. Essentially what is possible with swatches, but for all product options.

Problem:

I have created a view which lists out the products, the problem I'm having is understanding how to init a "mage.priceBox" widget against each configurable with its own spConfig. So when a customer changes the options, the price against the product is recalculated.

I've looked at how Magento does this for detail pages, it requires "Magento_ConfigurableProduct/js/configurable" and triggers this using x-magento-init

<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "configurable": {
                "spConfig": <?php echo $block->getJsonConfig() ?>
            }
        }
    }
</script>

But looking at core Magento, this is always based around having a single product form, referenced by its id in the x-magento-init.

Has anyone seen this done before or have any tips on having multiple configurable products add to cart forms on a single page?


texts:
I have a custom extension that adds 'testimonials' functionality to M2. The path that I can access these testimonials in the frontend is /testimonials/index/index. I've added a type field to the testimonials where I can set it to either "reviews" or "customer letters".

What I want to do is create two custom routes in this extension so that I can access in one the "customer reviews" through the /customer-reviews path, and in the other the "customer letters" with the /customer-letters path.

I've spent the last two days trying to figure this out and haven't been able to get it working.

Can you please guide me through this? I'm a frontend developer trying to do some backend stuff.

Thank you.


texts:
The line below works to display an attribute image instead of the attribute text on the product page (CE 1.9.2). Can someone please tell me the correct syntax to replace /myfolder/media/attributes/ with a reference to the MediaURL or if there is a better way to do this?

   <?php $ce=$_product->getAttributeText('ce');
echo '' ?>


texts: Is it possible to install using checkout from existing SVN?

texts:
Now I'm trying to install Magento2 using existing repository on Windows server.

So the more specified questions are followed :

If possible, then what files I have to modify?

Is there a refined convention of installing Magento2 this way?
Where can I get some study source about these topic?

If impossible, what is recommended way of doing this?

I have XAMPP(v3.2.2) installed on my Windows 10 machine.
I'm totally new to Apache, MySQL and Magento so somewhat abstracted answers would be appreciated.


texts: Increase / decrease qty directly on cart

texts:
I'm looking to have product quantities increased and decreased dynamically in cart when I press the plus and minus sign bypassing the add to cart functionality altogether.

I have looked thought many forums but can find no reference of this being done before.

Can someone point me towards a good starting point to start writing a module like.


texts: Magento 2.2.7. Cart subtotals not showing taxes

texts: According to the configuration of the screenshot, the taxes are still not showing on the cart subtotals. Any ideas why I am missing anyway?


texts: Can't edit Customer information on Account Dashboard

texts:
I dont get this Edit option on Account dashboard page in my magento 2.3
See https://prnt.sc/r0n52s
I am not getting this in my website.
Is there any configuration for this?

Thanks.


texts: How to apply custom shipping rate dynamically(on cart and checkout)?

texts:
I need to apply free shipping rate to a quote on the fly, once some condition is met. This condition can change when subtotal changes or user logs in/out. Once applied I'd like it to persist from cart to checkout.

I've been trying to set the shipping price from event observers that fire on:

<sales_quote_address_collect_totals_after>
<checkout_cart_update_items_before>

I tired:

1) Unsetting shipping amount on $quote->getShippingAddress();

$address->unsetData('shipping_amount');
$address->unsetData('base_shipping_amount');
$address->unsetData('shipping_tax_amount');
$address->unsetData('base_shipping_tax_amount');
$address->unsetData('shipping_incl_tax');
$address->unsetData('base_shipping_incl_tax');

This doesn't work because grand total is not being updated.

2) Setting carrier config from the observer:

$store = Mage::app()->getStore($quote->getStoreId());
$carriers = Mage::getStoreConfig('carriers', $store);

foreach ($carriers as $carrierCode => $carrierConfig) {
    $store->setConfig("carriers/{$carrierCode}/price", $newPrice);
}

Does not work either.

3) Setting another config from the observer:

$store->setConfig("carriers/freeshipping/free_shipping_subtotal", $newSubtotal);

This nearly worked but not for all cases. E.g. when $newSubtotal = 15 and actual order subtotal was 14.70 free shipping was applied - what should not happen.

Is there any other way I could do this? Thanks!


texts:
Sometimes the notification messages don't get disappear on page reload or when I navigate to the different page.

Is there some kind of timeout for the notification message or some session cookies?

I followed this link

  Magento 2 : Error/Success message won't remove from page after refresh once display

But where should I put this code so that _deleteMessage call every time when the page reloads or user navigates to a different page.

This issue is more prominent in iPhone devices safari browser.

This is my code in messages.js

  this.cookieMessages = _.unique($.cookieStorage.get('mage-messages'), 'text')[_.unique($.cookieStorage.get('mage-messages'), 'text').length-1];
  this.messages = customerData.get('messages').extend({
                disposableCustomerData: 'messages'
            });
  if (!_.isEmpty(this.messages().messages)) {
                customerData.set('messages', {});
            }
  customerData.set('messages', {messages: ""});
  $.cookieStorage.set('mage-messages', '');

On further debugging, My code randomly breaks anywhere due to WebAPI socket error on console js debugging.

So this WebAPI socket error doesn't let this cookie clear.
This issue is intermittent.

Thanks in advance


texts: Magento 1.9.2 - Optimize the search engine

texts:
When I write a word in my search bar the result is ever many items and I always find my searched product after many items.

To try to improve the search at the time I modified the file:

  app\code\core\Mage\CatalogSearch\Model\Resource\Fulltext.php

replacing

  $likeCond = '(' . join(' OR ', $like) . ')';

in

  $likeCond = '(' . join(' AND ', $like) . ')';

After this I modified in configuration -> catalog -> catalog search -> type of search and i choice "Like".

Finally I made the reindex of catalog search. I tried again the search but always with the usual results. I still continue to view many products before seeing mine.

What else can I do?


texts: Adding Checkbox in system configuration is not working

texts:
I want to add single check box in my extension like below.

Please check my system.xml

<config>
    <sections>
      <mymodule>
            <groups>
                <general translate="label" module="paygate">
                    General settings
                    <frontend_type>text</frontend_type>
                    <sort_order>10</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                      <visible_on_frontend translate="label">
                        Visible on Front-End
                        <frontend_type>checkbox</frontend_type>
                        <frontend_model>mymodule/system_config_form_frontendavail</frontend_model>
                        <sort_order>22</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>0</show_in_store>
                    </visible_on_frontend>
                  </fields>
                </general>
            </groups>
      </mymodule>
  </sections>
</config>

Frontendavail.php

<?php
class Namspace_Mymodule_Block_System_Config_Form_Frontendavail extends Mage_Adminhtml_Block_System_Config_Form_Field
{
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $html = "
           <input type='checkbox' class='required-entry' name='terms' value='1'>";
        return $html;
    }
}

After doing this check box is display but nothing is happens. Not saving data in database.


texts: Debugging Magento Checkout- Property getType of Null, when messing around with Billing and Shipping Address

texts:
I am doing some heavy customization on the checkout (pulling billing address to the first position, next to shipping address).

If have added a plugin to view/shipping.js:

define(
    [
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/action/select-shipping-address',
    'Magento_Checkout/js/checkout-data'
    ], function(
    quote,
    selectShippingAddress,
    checkoutData
    ){
    'use strict';
    return function(targetModule){

    var lastSelectedShippingAddress = null;

    return targetModule.extend({
        initObservable: function () {
            this._super()
                .observe({
                    isAddressSameAsBilling: true,
                    isAddressDetailsVisible: false // vs. isAddressFormVisible -- which one to use?
                });
            return this;
        },

        /**
         * @return {Boolean}
         */
        useBillingAddress: function () {
            debugger;
            if (this.isAddressSameAsBilling()) {
                selectShippingAddress(quote.billingAddress());
                this.isAddressDetailsVisible(false);
            } else {
                lastSelectedShippingAddress = quote.shippingAddress();
                quote.shippingAddress(null);
                this.isAddressDetailsVisible(true);
            }
            checkoutData.setSelectedShippingAddress(null);

            return true;
        },
    });
    };
});

And have bount useBillingAddress to a newly created checkox "Use billing address as shipping address".

Now when clicking this checkbox I get the following javascript error:

list.js:60 Uncaught TypeError: Cannot read property 'getType' of null
    at UiClass.createRendererComponent (list.js:60)
    at ko.subscription.callback (list.js:33)
    at Function.notifySubscribers (knockout.js:1103)
    at Function.observable.valueHasMutated (knockout.js:1300)
    at Object.observable [as shippingAddress] (knockout.js:1285)
    at UiClass.useBillingAddress (plugin.js:36)
    at HTMLInputElement.<anonymous> (knockout.js:3863)
    at HTMLInputElement.dispatch (jquery.js:5226)
    at HTMLInputElement.elemData.handle (jquery.js:4878)

But I am unable to track down how this error is caused using the javascript debugger.

I would be happy for any hints.


texts: magento2 creating a lot of catalogrule_product_temp tables

texts:
Magento2.2.5 based multisite (multi store view)seems to be creating a lot of temporary tables such as

catalogrule_product__temp9a310576
catalogrule_product__temp998786f4
etc...

However I am not sure why these tables are being created they all seem to be empty?


texts: I am trying to add custom header link, but it is not showing.


texts: Bulk remove all product images from a Magento 2 shop

texts:
We would like to remove all product images from the database and the file-system in Magento 2.2.8 shop.

There is a solution for Magento 1

Magento Delete all Product Images

Can this easily be adapted to Magento 2?

I am thinking about

rm -r pub/media/catalog/product/? pub/media/catalog/product/cache # keeping placeholder folder
And deleting from some tables in the database (which one) ?
Reindex

is this safe or are complications to expect?

We rather would not like to iterate over each product and save it, because of performance reasons.


texts: Magento 2 Migration Integrity constraint violation Duplicate Key

texts:
I am learning the Magento 2 platform and I am attempting to transfer the data over using the data migration tool. I have ported the settings already but I run into issues while trying to port over the data. After running the following command:

php56 bin/magento migrate:data --reset vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.3/config.xml

I get the following error:

[2016-08-02 20:26:32][INFO][mode: data][stage: data migration][step: EAV Step]: started
71% [====================>-------] Remaining Time: 1 sec

[PDOException]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '249' for key 'PRIMARY'

This is just too general to figure out what table has the problem and why. Does anyone know which file I can log to get a more detailed version of the sql query that is running to figure out why this is happening and what table it is on?


texts:
I am working on Mangento (1.9) website and the site uses a custom theme which is applied throughout all the pages. I didn't build the theme, the previous team who worked built the theme and the blog pages also used that theme and it worked fine until a few days ago.

The pages on the website uses the custom theme, though the blog is using a default theme (looks like web 2.0) that Magento provides (not sure as I am new with Magento, but it seems like it)

I did make some changes to the various XML files to add a few blocks but didn't change anything else in files like pages.xml.

The configuration of the blog seems to be alright on the admin panel

It took me a lot of effort itself to find how to edit the layout, and I've been searching about editing the configurations for which theme Blog should use but no results till now.

Any idea why it might be happening? I am very new to Magento so I am not sure where to look at.


texts: Magento 2 - Add google captcha on contact form

texts:
I want to add google captcha on contact us page.

copied

vendor/magento/module-contact/view/frontend/templates/form.phtml

to

app/design/frontend/Vendor/MyTheme/Magento_Contact/templates/form.phtml

is there any simple widget to call google captcha on form.phtml?


texts: Magento 2 : Multiple shipping address for every items of an order

texts:
Currently, I am using Magento 2.2 version I need customize the checkout page for add multiple shipping addresses like I want to separate shipping address for every item of an order.

Exp. I have added 3 different products to the cart and on the checkout page, I want to separate shipping address for each product.

Please give me your suggestion. Is it possible or not?


texts: open_basedir restriction in effect - since update

texts:
Since updating to the newest 1.9 version I get this error attached to a mail - every 5 Minutes...

I can't figure out what exactly is the problem.

ERR (3): Warning: is_file(): open_basedir restriction in effect. File(var/cookie) is not within the allowed path(s): (/var/www/vhosts/domain.de/:/tmp/)  in /var/www/vhosts/domain.de/httpdocs/downloader/lib/Mage/HTTP/Client/Curl.php on line 157

Can someone give me a hint?


texts: how to set magento 2 parent categories setting yes/no from database

texts:
UPDATE catalog_category_entity_int set value = 0 where attribute_id = 70
you can set parent categories setting yes 1 and no 0
attribute id you can find from database
SELECT * FROM eav_attribute where attribute_code = 'custom_use_parent_settings';


texts: how to get attribute label if it's a price attribute?

texts:
I'am trying to get all attribute label of a special attribute which type is "price". Here is my code but it's not retreiving the right value.

 $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', '170');
$options = Mage::getResourceModel('eav/entity_attribute_option_collection');
$table_screen = array();
foreach ( $values  = $options->setAttributeFilter($attribute->getId())->setStoreFilter(1)->toOptionArray() as $option){
$table_screen[] = (int)$option['label'];
}

Do you have any idea how to do that ?

Thanks,


texts: magento 2 - getCreatedAt() returns UTC time and not local time

texts:
I am trying to get the order time, I fixed the problem with orders with wrong time stamp in admin panel. Now I am trying to get the order date in my module.

The problem is

$created = $order->getCreatedAt()

returns the UTC time and not local time. I tried to use

$created = $order->getCreatedAtStoreDate();

But this one returns nothing. How should I get the orders date?


texts: How to convert sql query to magento in order to fetch data

texts:
I am developing a custom module which will enhance the magento reviews and rating, now i have created a custom table which will count votes on reviews(facebook comment like).

Now i have to convert the following sql query into magento query format, but i don't know how can i do this.

SELECT review_id,  COUNT(*) FROM reviews GROUP BY review_id, votes HAVING review_id=(SELECT review_id FROM reviews WHERE vote_id='<7>') AND votes='<1>'

point to remember is that, i have to do this using event observer not in models


texts: Create custom dropdown for custom module in magento product edit section

texts:
I have created my own custom module for "Critic Expert" feature. I want to assign a critic expert with each product so I have to add my custom dropdown with each product.

How would I can show the dropdown with my custom module values and save it along with product in admin section.

Please find attached screenshot for more details.


texts: how to migrate Open cart to magento site

texts: I have opencart website i wanna be a convert into  magento. if anybody have idea to migrate site opencart to magento please give me a feedbacks thanks


texts: Include customer address in customerCustomerCreate API call

texts:
Due to business and technical requirements, all customers must have an associated billing address when they're first created.  We've got this working great on the frontend and backend; however, there's currently no way to pass the address via the customerCustomerCreate v2 SOAP method.

Is it possible to somehow extend this method to accept the following billing address fields?

Street
City
State
Zip
Country

If so:

How would I add these to the WSDL?
How would I convert the submitted API data into an associated address?  Is there some event I could observe?

Thanks!


texts: Load products for specific store Magento 2

texts:
$products = $this->productFactory->create()
                                ->setStoreId($store_id) //this is not working
                                ->getCollection()
                                ->addAttributeToFilter('status', 1)
                                ->addAttributeToFilter('visibility', '4')
                                ->addAttributeToSelect('*');

I want products of Slovenian Website, not Main. Please help me.


texts: I can't access my store aftering changing Store URL

texts:
So, I tried to change my store URL with the following queries:

1. SELECT config_id FROM core_config_data WHERE path = 'web/unsecure/base_url'; (config_id was 6)

2. UPDATE core_config_data SET value = "http://kokorugs.com/store" WHERE config_id = 6;

3. SELECT config_id FROM core_config_data WHERE path = 'web/secure/base_url'; (config_id was 7)

4. UPDATE core_config_data SET value = "http://kokorugs.com/store" WHERE config_id = 7;

I do not have SSL.

In an attempt to access my store, I've tried the following:

After inputting "online-rug-store" into core_config_data id's 6 & 7, I got this error: "Illegal scheme supplied, only alphanumeric characters are permitted." No 404 redirect error.
Going to http://kokorugs.com/store -> Returns 404 error
Going to http://kokorugs.com/magento -> Redirects to http://kokorugs.com/store and returns 404 error
Resetting core_config_data to "http://kokorugs.com/magento" for config_id's 6 and 7 and trying to visit http://kokorugs.com/magento -> Returns 404 error
I have tried clearing cache by deleting contents in var/cache/ and var/session/ and no changes.

Before I reinstall magento and start from scratch, are there any other ideas that I should be trying?

THANK YOU FOR ANY HELP!


texts: How to return product collection from block in Magento 2

texts:
I want to get product collection in my block using dependency injection. How I can do it?
I've tried following code but it doesn't work.

public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection)
    {
        parent::__construct($context);
        $this->productCollection = $productCollection;

    }
public function getProducts()
{
    return $this->productCollection->load();
}


texts: UPS Error : Negotiated Price Not showing instead of showing Standard Price?

texts: I have configured UPS for my site, at checkout page UPS showing standard charges not showing my Negotiated Charges, how can configure to display my Negotiated Charges.


texts: Multi store: define a store as canonical

texts:
I have a Magento 1.8 multi store installation. Each store is installed in a sub folder (www.mydomain.com/, www.mydomain.com/paris/, www.mydomain.com/nimes/) and contains the same products with different stock values.

With such an install, I have a lot of duplicate content: www.mydomain.com/product1.html and www.mydomain.com/paris/product1.html are showing duplicate content.

That's why I'd like to define a store as canonical and have pages from other stores point to the corresponding page on the main store.

Any suggestion on how to implement this?


texts: the installer script is not firing magento?

texts:
i have setup the resource like the following at config file,

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <DigitalHorizons_Att>
        <version>0.1.0</version>
    </DigitalHorizons_Att>
    <frontend>
        <routers>
            <att>
                <use>standard</use>
                <args>
                    <module>DigitalHorizons_Att</module>
                    <frontName>att</frontName>
                </args>
            </att>
        </routers>
    </frontend>
    <global>
        <resources>
            <digitalhorizons_att_setup>
                <setup>
                    <module>DigitalHorizons_Att</module>
                    <class>DigitalHorizons_Att_Model_Resource_Setup</class>
                </setup>
            </digitalhorizons_att_setup>
        </resources>
    </global>
</config>

this is not fires the installer scripts at

  local\DigitalHorizons\Att\sql\digitalhorizons_att_setup\install-0.1.0.php

when i delete  DigitalHorizons_Att_Model_Resource_Setup class
at app\code\local\DigitalHorizons\Att\Model\Resource\Setup.php

it says the following error,

  Warning: include(DigitalHorizons\Att\Model\Resource\Setup.php): failed
  to open stream: No such file or directory  in
  E:\wamp\www\sample\lib\Varien\Autoload.php on line 93

the following content is there is at the installer file,

<?php
   echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
   die("Exit for now");
?>


texts: How to Display Attribute value in magento 2 using getProducts() Method

texts:
When I Try to get data using below code,But return null value.

 $_attributeValue = $block->getProduct()->getResource()->getAttribute('weight_spices')->getFrontend()->getValue($block->getProduct());

My Expected Result like (100g, 1Kg,1L etc ),I have weight_spices, weight_oil Attribute to identify spices and oil weight separately.  I'm trying lots of code but not working.how can i print expected Result ?.


texts: Multisite multistore contact form not sending (or not arriving)

texts:
one of our contact forms is not sending (or at least the email is not arriving). I googled this out, but to no avail.

We have the following set-up.

1 installation, 2 domains
1 domain setup as alias and using htaccess to set store flag
1 contact form CMS page used for both stores
store 1 is sending from noreply@store1.com to info@store1.com, set in contacts under config
store 2 is sending from noreply@store2.com to info@store2.com, set in contacts under config

Store 1 emails are arriving. Store 2 emails not.

We changed the Store 2 recipient email to a gmail. And this works!!!

And to make it even more complex

The order confirmation emails are being sent (to info@)


texts:
Is it possible to round the grand totals of checkout-cart up/down?
I need a "swedish rounding"?

Problem is I have some customized products with cent-prices, so I cannot change these fixed prices.


texts: Magento 1 - Discount for all products except

texts:
I am trying to add a discount code for 25% off everything except for specific SKUs but it isn't working.

Under the Actions tab, under "Apply the rule only to cart items matching the following conditions (leave blank for all items" I have set it to apply the rule if ANY of these conditions are TRUE, SKU is not (List of SKUs). However, it is still applying these discount to these SKUs.

Can anyone advise where I am going wrong?


texts: load by attribute sku not working some times

texts:
For Loading product by sku i'm using following function.
For some skus its working fine where as for some sku's not working.And these sku products existed in back end.

$_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);

Can you help anyone?