texts: Cancelling a \Magento\Quote\Model\Quote instance: Magento 2

texts:
I am having a custom module that makes use of the \Magento\Quote\Model\Quote to retrieve the quote instance.
I am getting the quote details properly as expected.

Here I would like to cancel the quotes on clicking a Cancel Quote Button.

The cancel quote button is calling the controller for cancel.

<button type="button" title="<?php echo "Cancel Quote"; ?>" class="action-default scalable" onclick="window.location = '<?php echo $this->getUrl('*/*/cancel', ['quote_id' => $_quotes[0]['quote_id']]) ?>';">

Here I want to cancel my quotes in the controller function.

In order, we can cancel order using something like below,

/**
 * Magento\Sales\Api\OrderManagementInterface orderManagement
 */
 $this->orderManagement->cancel($order->getEntityId());

Is there any way to achieve that with quotes?

I have already searched about it and gone through many links but they were not quite helpful in my case.

Please, can anyone help?


texts:
I am using Magento 1.9's RWD theme.

It does not display tags. You don't have the option to tag products on the frontend. There is no box that shows existing tags. And going to the page that should show tags (/tag/list/) gives a blank.

I read in the knowledge base that "Responsive design was not implemented for the following: ... Tags ..."

So is there a way to display tags on the frontend?


texts:
I want to do something after customer does the checkout. I found code like
  below from

vendor\magento\module-checkout\Model\Type\Onepage.php

public function saveOrder()
    {
        $this->validate();
        $isNewCustomer = false;
        switch ($this->getCheckoutMethod()) {
            case self::METHOD_GUEST:
                $this->_prepareGuestQuote();
                break;
            case self::METHOD_REGISTER:
                $this->_prepareNewCustomerQuote();
                $isNewCustomer = true;
                break;
            default:
                $this->_prepareCustomerQuote();
                break;
        }
        $order = $this->quoteManagement->submit($this->getQuote());
        if ($isNewCustomer) {
            try {
                $this->_involveNewCustomer();
            } catch (\Exception $e) {
                $this->_logger->critical($e);
            }
        }
        $this->_checkoutSession
            ->setLastQuoteId($this->getQuote()->getId())
            ->setLastSuccessQuoteId($this->getQuote()->getId())
            ->clearHelperData();

        if ($order) {
            $this->_eventManager->dispatch(
                'checkout_type_onepage_save_order_after',
                ['order' => $order, 'quote' => $this->getQuote()]
            );

            /**
             * a flag to set that there will be redirect to third party after confirmation
             */
            $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();
            /**
             * we only want to send to customer about new order when there is no redirect to third party
             */
            if (!$redirectUrl && $order->getCanSendNewEmailFlag()) {
                try {
                    $this->orderSender->send($order);
                } catch (\Exception $e) {
                    $this->_logger->critical($e);
                }
            }

            // add order information to the session
            $this->_checkoutSession
                ->setLastOrderId($order->getId())
                ->setRedirectUrl($redirectUrl)
                ->setLastRealOrderId($order->getIncrementId())
                ->setLastOrderStatus($order->getStatus());
        }

        $this->_eventManager->dispatch(
            'checkout_submit_all_after',
            [
                'order' => $order,
                'quote' => $this->getQuote()
            ]
        );
        return $this;
    }

  Is it true that the function above for saving the order when customer
  doing checkout? I tried to add some SQL query inside to save data to
  my custom table, but when I tried to do the checkout, the SQL doesn't
  run.


texts:
I have added custom form in checkout and its working fine but i want to move existing email field in that custom form when it tried to move email field block in custom form then its not working.
If anyone has any idea about it then please kindly let me know how can move existing email field to custom form.
Thanks,
Rahul


texts: Magento2: Ho w to get parameters order in last step checkout

texts:
I want add below code to last step chechout with confirmation order.

Anyone help how to get this parameters?

dmq('track', 'Purchase', {
transaction_id: 'ORDER ID',
value: 90.00,
shipping_cost: 19.90,
discount_code: 'KOD15',
contents: [{
id: 'PRODUKT_ID1',
name: 'PRODUCT NAME',
ean: 'PRODUCT BARCODE',
price: 10.00,
quantity: 1,
in_stock: true
},
{
id: 'PRODUKT_ID2',
name: 'NAZWA_PRODUKTU2',
ean: 'PRODUKT_EAN_ID2',
price: 20.00,
quantity: 2,
in_stock: true
},
{
id: 'PRODUKT_ID3',
name: 'NAZWA_PRODUKTU3',
ean: 'PRODUKT_EAN_ID3',
price: 30.00,
quantity: 1,
in_stock: true
}]
});


texts: How to get store and store view code from Product Review?

texts:
I'm using magento 1.7. I want export product reviews from magento. For that, I want to find the store and store view codes of the product review. I tried the below, But It does not work.

$review_store = Mage::getModel('review/review')->getStoreId();
$review_storviews = Mage::getModel('review/review')->getStores();

How to get the store and store view from product review object?


texts: Steps to send message to all numbers in our database in magento backend

texts: Would like to send informational message to all customers of our store. Kindly suggest how do I do that ?


texts: Magento 1.9 save() not working in modle but working in controller

texts:
Last days I am using mysql 4.1
and now mysql version is 5.5
But when is am using 4.1 all save method is working but not they are not working in model but work in controller
2 days goes and many time search on google but not getting success.I am not sure why this is not working


texts: MFTF vendor/bin/mftf generate:tests show error of connection timeout in magento 2.4

texts:
I am doing setup of MFTF (for M2.4.1 ) so my standalone server My magento is inside a folder so the url is like : http://ip/m2-mftf/
When I hit http://ip/m2-mftf/magento_version this shows me Magento/2.4 (Community) as result on browser.
But when I hit vendor/bin/mftf generate:tests
It shows me error in MFTF.log as below:
[2021-04-29 13:15:02] Magento\FunctionalTestingFramework\Util\ModuleResolver.INFO: Fetching version information. {"url":"http://<ip>/m2-mftf/magento_version"} []
[2021-04-29 13:17:11] Magento\FunctionalTestingFramework\Util\ModuleResolver.INFO: version information {"version":"No version information available."} []
[2021-04-29 13:19:22] Magento\FunctionalTestingFramework\DataTransport\Protocol\CurlTransport.ERROR: Failed to connect to <ip> port 80: Connection timed out []

Site is working fine on browser, All info. is correct in app/etc/evn.php & .env in dev/tests/acceptance folder.


texts: How to get collection from table 'sales_flat_creditmemo_item'

texts:
I am very much new in magento. So please sorry me for this quetion.

My question is : How can I get collection from table "sales_flat_creditmemo_item"


texts: Is there a way to get an item at the nth index from a collection without necessarily loop over all the collection?


texts: Convert multiple configurable product select boxes to checkbox

texts:
I have a configurable product that is configurable by 2 attributes:

product_type
product_size

By default, magento displays this as 2 select boxes.

This is fine.

However, I would like to change this to display radio buttons instead for each type/size option.

For example the x indicates a selected option the dashes indicate radio buttons

                     small  medium  large  x-large
short-sleeved          -       -      -      -
long-sleeved           -       x      -      -

The code is in template:catalog/product/view/type/options/configurable.phtml

My question is how to convert the two select boxes and do this more table like structure instead?

Im not looking for exact code, more just an idea of how to take the attribute collection and output it in the format needed


texts: Magento 1.9.0.1 + Patch SUPEE-6788 breaks custom theme

texts:
I have tried to apply the new patch SUPEE-6788 on my website which was successful without any errors.

After that I recompiled Magento using Configuration > tools > compilation. After doing that my custom theme layout broke. It is missing some blocks etc.

Any suggestions on this please?


texts: Magento2: How to generate shipping label using Fedex/DHL/UPS in my custom module?

texts:
I am using Fedex/DHL/UPS in my magento2 store and now I want to print shipping label in my custom module by provide shipping address.
Is there any API available to handle this? or any other way to achieve this?
Thanks


texts: What is OpenMage magento-lts? and how it works? What are the main difference between magento 1.9 and OpenMage Magento-lts? What type of extensions does it use. Please explain in detail. I don't know anything about it.


texts: Onestep checkout shipping price not displayed

texts:
I have an issue in One Step Checkout with Total and subtotal prices including shipping not being displayed after shipping method selection. I get only product price:

Do you have any ideas? This is the part I'm missing (tooked from other magento e-shop):


texts:
I want to translate the totals row in Magento 2 in the order e-mail.

The strings are: Shipping & Handling / Grand Total.
I edited both in the i18N file, but it doesn't change in the email. I have flushed the cache and runned a reindex.

I can't find the template wherein this string is located. If I know where that one is, maybe I'll find the right words to translate.


texts: Magento 2 - Update quantity and totals of cart page without page reload?

texts:
In Magento2 - We need to update main cart on change of quantity by Ajax without click on "Update Cart Button" and without reloading the page,
Below my code in this code only update cart subtotal but not updated cart page summery sidebar subtotal.

 require(['jquery', 'Magento_Customer/js/customer-data',
    'jquery/jquery-storageapi'], function ($) {
    // $("#submitbutton").hide();
    var form = $('form#form-validate');
    var qtyfields = $('input.qty');
    $('.page.messages').each(function () {
        var thismessage = $(this);
        thismessage.attr('id', 'messages');
    });

    form.find(qtyfields).each(function (e) {
        var thisfield = $(this);
        $(this).change(function () {
            console.log('change detected');
            form.submit();
        });

    });
    $(document).on('submit','form#form-validate', function (e) {
        var thisfield = $(this);
        var thisiteminfo = thisfield.closest(".item-info");
        var thissubtotal = thisiteminfo.children(".subtotal");
        var formsubtotals = $(this).find('.subtotal');
        e.preventDefault();
        $.ajax({
            url: form.attr('action'),
            data: form.serialize(),
            type: 'post',
            success: function (res) {
                var parsedResponse = $.parseHTML(res);
                var result = $(parsedResponse).find("#form-validate");
                $("#form-validate").replaceWith(result);
                var totals = $(parsedResponse).find("#cart-totals");
                $("#cart-totals").replaceWith(totals);
                console.log(totals);
                //location.reload();
            },
            error: function () {
                console.log('error');
            }
        });
        console.log('form submitted');
    });
});

Please help me for find best solution.


texts: Magento translation problem after moved to another server

texts:
After I moved the magento shop (1.8.1) to another server, the language in the frontend is mixed up.

Locale is set to german, but there are a lot of strings displayed in english.
The file permissions are currently set to 777.
Reinstallation of the german languagepack didn't help.

A new magento installation on the same server for testing purpose did not show this behaviour: all strings are correctly translated.

After playing around with the files in app/locale/de_DE/, I figured out that the translation is working as long as the string to translate is present in 1 file only.
As soon as another file comes up with a translation for the exact same string, the translation is falling back to english.

For example I have deleted all files except Mage_Catalog.csv, which contains the desired string to translate => the translation is working.
Now I add for example Mage_Checkout.csv, which contains the exact same string => translation isn't working
I can add as many .csv files as I want, as long as the specific string is unique in all files, the string is translated correctly.

Nothing is shown in logfiles.

What can cause such behavior?


texts: Magento 2: How to get data from controller to block/view

texts:
I am looking for the right flow of data of how Magento wants me to do it. I have some data which I want to pass to the view. How do I do this the right way?

I saw the following answer for Magento 1.x https://stackoverflow.com/a/4006908/2190322

Does this apply in the same way for Magento 2? Are there differences in the flow/implementation or is it the same? If there are some differences which are these and how do I implement them?

I also saw this question: https://magento.stackexchange.com/a/82376/5827 But it has no answer regarding to best practices, which I am looking for.


texts: Update Customer Data in Magento2 with custom attribute

texts:
I want to update the firstname of a customer like this :

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$customerFactory = $objectManager->create('\Magento\Customer\Model\CustomerFactory');

$customer = $objectManager->create('Magento\Customer\Model\Customer')->setWebsiteId(1)->loadByEmail('cust123@gmail.com');

try {
    if(!empty($customer->getData('email')))
    {
        $customer->setFirstname('JokeAccount');
        $customer->save();
    }
}

But the name of the customer doesn't change


texts:
Can someone explain the importance/relevance of the backend_type static for an attribute?

I am having some problems with an attribute not being loaded and I'm wondering whether this backend_type has anything to do with it?

Also, is this related in some way as to what is put in the flat tables?


texts: How can solve error Magento 1.xx on PHP 7?

texts:
Magento 1.9.4 not run with PHP 7, it showing error as below:

Fatal error: Uncaught Error: Function name must be a string in
app\code\core\Mage\Core\Model\Layout.php:555 Stack trace: #0
app\code\core\Mage\Core\Controller\Varien\Action.php(390): Mage_Core_Model_Layout->getOutput() #1
app\code\core\Mage\Cms\Helper\Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout() #2
app\code\core\Mage\Cms\Helper\Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home') #3
app\code\core\Mage\Cms\controllers\IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home') #4
app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Cms_IndexController->indexAction() #5
app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index') #6
app\code\core\Mage\Core\Model\Layout.php on line 555


texts:
I added another category item and now "Contact us" is below that section

I would like to know how can I extend the menu section so that everything remains in one row. This is the website  https://usengineproduction.com
my css


texts: Magento 2 :upload file type restrict to pdf only

texts:
I have created a custom file type customer attribute

$customerSetup -> addAttribute(\Magento\Customer\Model\Customer::ENTITY,
    'price_agreement',
    [
        'type' => 'text',
        'label' => 'Price Agreement File',
        'input' => 'file',
        'source' => '',
        'required' => false,
        'visible' => true,
        'position' => 200,
        'system' => false,
        'backend' => ''
    ]
    );

$customerSetup->getEavConfig()->getAttribute('customer', 'price_agreement')->setData('is_user_defined',1)
                                 ->setData('is_required',0)
                                 ->setData('default_value','')
                                 ->setData('used_in_forms', ['adminhtml_customer', 'customer_account_create', 'customer_account_edit'])
                                 ->save();

}

I want to restrict this field to upload only .pdf format. No other format should not be able to upload.Where can I set setAllowedExtensions for this attribute.

Any help??


texts: Problem to join the sales_flat_order_item

texts:
I have a issue when I join the table sales_flat_order_item in my Grid.

What I'm trying to do is add a collumn with the name product ordered, follows the code below.

require_once('../app/Mage.php');
Mage::app();
$orders = Mage::getModel('sales/order')->getCollection()
        ->join(array('payment'=>'sales/order_payment'),'main_table.entity_id=parent_id','method')
        ->join(array('address'=>'sales/order_address'),'main_table.entity_id = address.parent_id AND address.address_type = "shipping"', array('postcode', 'city', 'region'))
        ->join(array('sfoi' => 'sales_flat_order_item'), 'main_table.entity_id = sfoi.order_id', array('sku'))
        ->addAttributeToSort('created_at', 'DESC');

I created another file for tests.

The code above outputs this error:

Fatal error: Uncaught exception 'Mage_Core_Exception' with message 'Can't retrieve entity config: sales/sales_flat_order_item' in /var/www/html/homepages/bodebrown.com.br/www/loja/app/Mage.php:594 Stack trace: #0 /var/www/html/homepages/bodebrown.com.br/www/loja/app/code/core/Mage/Core/Model/Resource.php(272): Mage::throwException('Can't retrieve ...') #1 /var/www/html/homepages/bodebrown.com.br/www/loja/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(284): Mage_Core_Model_Resource->getTableName('sales/sales_fla...') #2 /var/www/html/homepages/bodebrown.com.br/www/loja/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(488): Mage_Core_Model_Resource_Db_Abstract->getTable('sales_flat_orde...') #3 /var/www/html/homepages/bodebrown.com.br/www/loja/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(569): Mage_Core_Model_Resource_Db_Collection_Abstract->getTable('sales_flat_orde...') #4 /var/www/html/homepages/bodebrown.com.br/www/loja/teste/testando.php(8): Mage_Core_Model_Resource_Db_Coll in /var/www/html/homepages/bodebrown.com.br/www/loja/app/Mage.php on line 594

EDIT (I forgot the second code:)

Ok, I'm also trying this code below,

require_once('../app/Mage.php');
Mage::app();
$orders = Mage::getModel('sales/order')->getCollection()
        ->join(array('payment'=>'sales/order_payment'),'main_table.entity_id=parent_id','method')
        ->join(array('address'=>'sales/order_address'),'main_table.entity_id = address.parent_id AND address.address_type = "shipping"', array('postcode', 'city', 'region'))
        ->join( 'sales/order_item', '`sales/order_item`.order_id=`main_table`.entity_id',
            array(
                'name'       => new Zend_Db_Expr('group_concat(`sales/order_item`.name SEPARATOR ",")'),
            )
          )
        ->addAttributeToSort('created_at', 'DESC');

This one outputs the following result:

As I'm using the mysql function GROUP_CONCAT, all the name products is returned and only the first order is showed.

Somebody can help me?

Thank you guys!


texts: Magento 2.2.2 multillanguage url rewrite

texts:
using Magento 2.2.2, I have a store with two views English and French,

I want to make urls looks like

domain.com/en/product1
domain.com/fr/category1

...

thanks


texts: How to programmatically create an order in Magento 2 w/o using a cart/quote?

texts:
I've read a lot of answers to similar question, however all of them are suggesting to create cart/quote and then call placeOrder() or something similar.

I need to create 'historical' orders. They differ from 'normal' orders:

They shouldn't affect current stocks
They may have items that are currently out of stock or disabled
They may have items prices that are different from current prices
Taxes, shipping prices, totals/subtotals are calculated in the past, so we should apply 'historical' values, and shouldn't let Magento 2 calculate them

Any help/thoughts?


texts: Magento 2: Custom Payment Module with Credit Card Form

texts:
I created a custom Payment Module from http://cedcommerce.com/magento-2-module-creator/payment-module .
But this payment module has a simple Place Order button. I need a Credit Card form in payment module. Can someone help me? All the answers will be appreciated.


texts:
I have got just one question, can you tell me how to change the tier prices withing the simple variants of a configurable product afterwards? I tried and saved the change in the simple variants but it is not shown on product page, there are still the "old" tier prices.
It would be grerat if somebody could help me.


texts: Filter Magento collection with nested "OR" "AND" filter

texts:
I am trying to determine how to filter a Magento collection from a flat table that would produce a WHERE clause with an AND that is followed by expression with a nested OR, which has nested ANDs, such as:

SELECT * FROM `my_model_flat_table`
WHERE (`customer_id` = 123456)
AND (
    ((`colA` = CONSTANT_A) AND (`colB` = $variableA))
    OR
    ((`colA` = CONSTANT_B) AND (`colB` = $variableB))
)

Short of doing this as two separate collections, loading and then merging them, I'm at a loss.

I'm trying to do this in a “Magento-friendly" way without resorting to:

$myCollection = Mage::getModel('mymodule/mymodel')
    ->getCollection()
    ->addFieldToFilter('customer_id',123456)
    ->getSelect()
    ->where(...put the nested logic in here...);

I've looked over the information at the following links, with no luck:

http://alanstorm.com/magento_collections
http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-8.html
https://stackoverflow.com/questions/3826474/magento-addfieldtofilter-two-fields-match-as-or-not-and

What I have done at this juncture is to go with a SQL SELECT, rather than using Magento's Collections, to retrieve the IDs of resources I need. From there I am loading the individual objects as needed:

$resource = Mage::getSingleton('core/resource');
$dbReader = $resource->getConnection('core_read');
$tableName = $resource->getTableName('mymodule/mymodel');
$query = "SELECT mymodel_id FROM {$tableName} WHERE customer_id = :cId AND
    ((colA = :eiType AND colB = :eiId) OR (colA = :mcType AND colB = :mcId))
    ORDER BY mymodel_id DESC";
$bindings = array(
    'cId'    => $customerId,
    'eiType' => $foreignKeyCodeA,
    'eiId'   => $foreignKeyA,
    'mcType' => $foreignKeyCodeB,
    'mcId'   => $foreignKeyB,
);
$myModelIds = $dbReader->fetchCol($query,$bindings);

This is not what I wanted to do, but it does cut down on making multiple Collection loads to get to the data I need.

I also want to note that in the database colA and colB form a unique index, so the 'OR' in the SELECT statement will not result in data collisions.


texts: Magento 2: theme translation does not work

texts:
Magento 2.2.9

I have a third party module (vendor/mirasvit/module-search-autocomplete). It comes with several translatable strings (i18n/en_US.csv).

I want to translate the string Show all %1 results → in my theme folder (theme/i18n/de_DE.csv): "Show all %1 results →","Zeige alle %1 Ergebnisse →"

That file already contains a lot of working translations (mainly from magento core) but no matter what I do, this string will not be translated. I cleaned caches (magento and browser), I deleted everything in pub/static/frontend, setup di compile... nothing helps.

Just for testing purposes I also modified the translatable string in the modules core. Just to make sure it is the right one. Nothing.

It only works when I put a de_DE.csv file into the modules i18n folder. But that is not what I really want to do for obvious reasons.

How? What? Why? It does not make any sense to me.


texts: Where is Content block for <reference name="content" tag

texts:
if I use a layout such as:

<layout>
   <{handle}>
       <reference name="content">
          ... {blocks} ...

According to docs and tutorial
the reference's name attribute points to referencing an existing block so I'm just wondering where is the content block defined?

Help much appreciated.


texts:
we're using this varnish module http://www.magentocommerce.com/magento-connect/pagecache-powered-by-varnish.html V 3.1.2.
With this module comes a default.vcl which really works well out of the box, but there is a part of the sub deliver that I don't get.

When an html object is cacheable, the sub fetch sets  http.magicmarker=1

Here's what happens in the sub deliver :

if (resp.http.magicmarker) {
    # Remove the magic marker
    unset resp.http.magicmarker;

    set resp.http.Cache-Control = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
    set resp.http.Pragma = "no-cache";
    set resp.http.Expires = "Mon, 31 Mar 2008 10:00:00 GMT";
    set resp.http.Age = "0";
}

Is there a reason to set Cache-Control and Pragma to "no-cache" ?

Here is the full vcl provided with the module : https://gist.github.com/ashsmith/5429365/raw/07f047d679edfdca0a52a62b606e2dd871c360a4/default_3.0.vcl

Thank you for your help


texts: Magento2 QTY is always decimal, is this default? Can it be set non decimal?

texts:
My QTY is always in decimal for all products I import, is the decimal qty actually magento2's default?

I've set the column on my import, but it seems I always get the decimal regardless. How do I set this properly?

See a lot about, is_qty_decimal, doesn't really appear to do anything of course.


texts: Transfering / Migrating an entire Catalog

texts:
Ive been trying to transfer the entire catalog from one Magento server to another and I've been experiencing some significant problems.

I can get most of the catalog data across, but I always end up missing something like product swatches, product categories or a product's custom options. To get these across I then end up building my own scripts that queries Magento, writes the data to a CSV file of my own design, and then write another script that will add this data to the other server.

Ive been asking the other developers in house, and apparently this is how they do every migration. They spend ages building lots of custom scripts just to transfer the catalog across, and apparently the different Magento sites are so different they have to build entirely new scripts when they transfer the next site.

Is this a common experience for everybody?

I feel like there must be a better way. Does anybody know of a better way to transfer the entire catalog (not just the products, but everything) to another server? Can we not just copy across the entire SQL Database?


texts:
I have a question about how to work with multiple stores and only one gruntfile.js file.

Has anyone done something similar?


texts:
How do I get items in the cart to apply discount if some product attributes are different, to explain. I have this rule set up for a 4 for £10 promo:

If ALL  of these conditions are TRUE :
If total quantity  is  4  for a subselection of items in cart matching ALL  of these conditions:
Category  is  26
Bottle Size  is  10ml
VG/PG Mix  is  50/50

and this works if the items are all the same. However, these items have different flavour (attributes) and when we add say 2 of one flavour and 2 of another the discount does not apply. It's the same scenario with different child/single associated products. I've tried adding flavours etc. to the rule but this makes no difference to the outcome.

Has anyone experienced this and found a resolve or can someone tell me where I am going wrong please as this is driving me insane?

I'm using magento 1.9.3.8

Many many thanks


texts: What is the usage of itemId inside Update inventory REST API?

texts:
According to the swagger, the REST API PUT /V1/products/{productSku}/stockItems/{itemId} is used to update the product inventory.

However, for the attribute value itemId, I found no differences no matter I entered which values. So, the following request URLs can update the same product without any errors AND return the same integer value:

http://<magento_url>/rest/V1/products/{productSku}/stockItems/1
http://<magento_url>/rest/V1/products/{productSku}/stockItems/{correctItemId}
http://<magento_url>/rest/V1/products/{productSku}/stockItems/999999

Given that the {productSku} is a simple product, my question is: What is the exact usage of itemId in the request URL?


texts: How to add the email field to my pdf shipping invioce? Magento2

texts: I want to add the email field to my pdf shipping invoice and change the size of the logo.


texts:
Weird things happening. I've written a customized product import script which is executed as a shell script. In this script, I gather some XML input, parse it into an array and then try to import the data using a custom class
MD_ImportProduct_Model_Import extends Mage_Core_Model_Abstract

However, executing the class method, it dumps the source code of the class file rather than execute it. And then I see a fatal error "PHP Fatal error:  Uncaught Error: Call to a member function setImportData() on boolean"

            $model = Mage::getModel('md_importproduct/xml_parser');
            $model->setXmlFilePath($file);
            $data = $model->getPairedData();
            Mage::getModel('md_importproduct/import')->setImportData($data)->execute();

What really freaks me out is when I run the script in my browser (or actually an isolated test case with just the app/Mage.php bootstrap and this line):

$md = Mage::getModel('md_importproduct/import');

It still dumps the class file contents and the following:
低�

Have I been hacked? The problem does not occur on a staging environment. There are no code differences in the custom model, so I assume the issue might be deeper inside the Mage core .. but I don't see any recently changed files or other obvious differences. I'm afraid I have no idea where to look ..

Why would the source code be dumped?


texts:
I am on Magento CE 1.8

I am using a 3rd party database to feed my database, as a source for products
that change every day in new issues or updates (availability o not, etc..).

The question is about indexing: should I leave to indexing manually or on save ?

Thanks...


texts: Magento 2: Zend_Http_Exception Invalid header line detected

texts:
I am get the following error:

[Zend_Http_Exception] Invalid header line detected.

In the terminal when running such below commands as:

php bin/magento cache:flush or
php bin/magento setup:upgrade

This issue seems to come out of no where. I have looked around the internet and have found people with the same issue recently but no solutions.

I was wondering if anyone has managed to get a solid fix for this or knows what the cause is?


texts:
How are the grid mixins in Magento 2 (vendor/magento/magento2-base/lib/web/css/source/lib/_grids.less) supposed to be used.

For example: I want to display 3 divs as equal columns with margin in between (but not on the outer left and right) - how can I use the grid system for that?


texts: Magento CE 1.9.0.1 double login and redirects back to login

texts:
When I go to the admin, Magento request the user and password as it normally should but after I enter my credentials and send I am seeing this:

If I enter anything in there I go back to the normal login page, any ideas?

TRIED ALREADY

Deleted var/session and var/cache
Changed session backend to DB in local.xml
skin/adminhtml/default/default/css folder is untouched (I compared it to stack code)

CONTEXT

The site has been suffering from a series of attacks because of this AMI
and after the incidents, I decided to restore snapshot and install all security patches by myself and I ended up not being able to access admin portal by the described behavior.


texts:
In search bar when i am searching a product using sku (100.40.10),

It displays all the product whose sku is having prefix (100.xx.xx) ,

But i only want it to fetch whose sku is (100.40.10).


texts: Magento 2: Should the static version index?

texts:
I'm new to Magento. I'm wondering about static versions.

I understand their purpose, but wondering if for SEO they should be indexable or non-index?

Thanks.


texts:
My magento indexing page showing processing only.

I  tried http://www.magikcommerce.com/blog/how-to-resolve-magento-reindexing-errors-in-your-magento-store/#

not working, could anyone please suggest a solution for this

actual error after clicking on reindex data

Fatal error: Class 'Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable' not found in /home/damarokiatest/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php on line 37


texts: When login with social login mini cart count is not updating in Magento 2

texts:
When login with social login like Facebook, Gmail, the mini cart items count is showing 0 and when I click on cart page then it will reload the count.

In Default Magento Login is working fine. Please refer my below screenshot for reference.


texts: How to restrict allowed catalog image extensions?

texts:
I created a module that overrides ImageUploader like so:

<preference
    for="Magento\Catalog\Model\ImageUploader"
    type="MyCompany\MyModule\Model\Catalog\ImageUploader" />

The code looks like this (don't ask why, but we are only allowing jpg images):

<?php

namespace MyCompany\MyModule\Model\Catalog;

class ImageUploader extends \Magento\Catalog\Model\ImageUploader {

    /**
     * @param string[] $allowedExtensions
     */
    public function setAllowedExtensions($allowedExtensions)
    {
        parent::setAllowedExtensions(['jpg', 'jpeg']);
    }
}

I installed the module and the other parts work just fine. But this does not prevent me from uploading a PNG. Anyone have any ideas of what I might be doing wrong or what I should override instead of this?

Thanks!


texts: Magento 1.9: Newsletter subscribe checkbox not working

texts:
I have installed magento 1.9 and have newsletter subscribe checkbox,
whenever i check it and submit success message shows but again checkbox is unchecked similarly for the unsubscribe case.

I there any solution to this problem.
Enabled the Mail chimp extension, which is working fine, but only checkbox is not working as expected.


texts: Magento 2: Forgot Password mail not receiving to some customers

texts: I am facing a weird issue, some of the customers not receiving password resetting email(not in spam also) after they request Forgot password, but I have tested with several test accounts these are working fine, not sure what's happening with other customer, anyone familiar with this issue? any logs for this? can I check through the database?


texts: Magento - Display different text for different customer groups (depending)

texts:
I have a magento store with seven different customer groups. My goal is to display a little text - depending on the customer group - under the price at the product page  (price.phtml).

Customer Groups:
Group0 and Group1 need one text (ex. text for Group01)
Group2, Group3 and Group 4 need their own text (ex. text for Group234)
Group5, Group6 and Group 7 also need their own text (ex. text for Group567)

So far I have got this working for one customer group:

<?php
    $_isLoggedIn = $this->helper('customer')->isLoggedIn();
    if($_isLoggedIn == true){
    $_myGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
    if($_myGroupId == 1){
    ?>
<?php echo $this->__("ex. text for Group01") ?>
    <?php
            }
        }
        ?>

Now my problem is to change the function to an if-elseif-else... can anyone help me complete this function?

Thank you very much in advance
Tina


texts: default.xml showing error "Cannot resolve symbol 'string'" in PHP Storm IDE, but it's not effecting anything. Is this ok? Or is there something wrong?


texts: Found 3 elements with non-unique id #agreement#1 Magento 2.1

texts:
I have total 3 payment method integrated  on default Magento checkout.

please check screenshot and let me know solution

https://www.screencast.com/t/V0ASd12aGKnP

Advance Thanks


texts: Difficulties with multstore setup in magento 2

texts:
My main issue is that my catalog navigation does not show up on either of my magento store home pages. Here's the steps I took.

create root categories for each store view
create website, store and store view, linking to appropriate root category
change base urls for each view ie example.com/store1, example.com/store2 where store1 and store2 are my store codes
change default home page to a custom cms page
create a cms landing page where the customer will choose which store to visit by a url link that matches the url link of the store view.

My landing page with store links seems to work but when I test the links the catalog navigation won't appear. Is there a step that I missed that will make it appear?

Update:I setup parked domains for my two different stores thanking that might be the problem. The store urls seem to be working but it won't return the right theme or right catalog nav. I'm so confused right now, please help me!


texts:
I'm experiencing a wierd problem with Magento EE.

In a checkout Ajax call response there are several cookies set, same Cookies multiple times.

Anyone experienced the same problem? Any insight what might be cause for this?

Update: Cookies are

CUSTOMER
CUSTOMER_INFO
CUSTOMER_AUTH
CART
CUSTOMER_SEGMENT

These are the repeating cookies, CUSTOMER_SEGMENT most often. In addition there are
COMPARE, VIEWED_PRODUCT_IDS and RECENTLYCOMPARED once.


texts: SQLSTATE[HY000]: General error: 1813 Tablespace for table dbname.design_config_grid_flat exists

texts:
I'm getting the following error when I try to run the php bin/magent  command and I'm not sure how to fix it

SQLSTATE[HY000]: General error: 1813 Tablespace for table '`magento_e`.`design_config_grid_flat`'
ists. Please DISCARD the tablespace before IMPORT., query was: CREATE TABLE     IF NOT EXISTS `design_
nfig_grid_flat` (
`entity_id` int UNSIGNED NOT NULL COMMENT 'Entity ID' ,
`store_website_id` int NULL COMMENT 'Store_website_id' ,
`store_group_id` int NULL COMMENT 'Store_group_id' ,
`store_id` int NULL COMMENT 'Store_id' ,
`theme_theme_id` varchar(255) NULL COMMENT 'Theme_theme_id' ,
PRIMARY KEY (`entity_id`),
INDEX `DESIGN_CONFIG_GRID_FLAT_STORE_WEBSITE_ID` (`store_website_id`),
INDEX `DESIGN_CONFIG_GRID_FLAT_STORE_GROUP_ID` (`store_group_id`),
INDEX `DESIGN_CONFIG_GRID_FLAT_STORE_ID` (`store_id`),
FULLTEXT `DESIGN_CONFIG_GRID_FLAT_THEME_THEME_ID` (`theme_theme_id`)
) COMMENT='design_config_grid_flat' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci


texts: how to get customer order count for all customers in magento

texts:
I Tried this and it is working but i can only do for a specific customer but i need this for all customer.

<?php
$customer_id = 5;
$_orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id',$customer_id);
$_orderCnt = $_orders->count(); //orders count
echo 'Customer with ID '.$customer_id.' has '.$_orderCnt.' orders';
?>


texts: Magento CE 1.9.1.0 - REST API - Log in as a Customer?

texts:
I've recently had some success on setting up a REST client via PHP to OAuth authenticate on a Magento 1.8.x backend. I've run the same process over on my Magento CE 1.9.1.0.

Expected authorisation screen:

What actually comes up:

Besides the design difference, it does seem that the router takes me to the frontend rather than the backend. I have created a new REST role called Admin with full privileges and have added my main admin user to that role (same process that I used on Magento CE 1.8.x).

Has anyone else experienced this? Could this possibly be a bug?

It seems that no matter what I type into the 'Log In As A Customer' screen, I get redirected to the main customer login page.

My endpoints are as follows:

$callbackUrl = "http://foo.bar/test.php";
$temporaryCredentialsRequestUrl = "http://foo.bar/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://foo.bar/oauth/authorize';
$accessTokenRequestUrl = 'http://foo.bar/oauth/token';
$apiUrl = 'http://foo.bar/api/rest';


texts: Adding extra params to custom option select html

texts:
I'm working on a custom theme for a client. Is it possible to add extra parameters to the html for the custom options select without having to extend Mage_Core_Block_Html_Select or Mage_Catalog_Block_Product_View_Options_Type_Select?

I can see in Mage_Core_Block_Html::_toHtml() that there is a call to $this->getExtraParams() but I can't seem to find anywhere that I would utilize this.

Is there a simple way to do this?


texts: M2 - How to get store information in knockout

texts:
How can I get store information in KnockOut?

For example: When a customer selects "Pickup @ Store" as shipping method, I need to update the shipping address to the address of the store.

The customer has the option to not ship to his home address but pick the package up up at a physical shop location. In that case the shipping information should show the shop location address and not the customer address. So i need the shop location address configured in the backend of Magento. How can i pass that information (configuration settings) to Knockout?


texts: Magento 2 - How to CAST & CONVERT Datatype VARCHAR to INT in query?

texts:
I have custom extension in magento 2.
In that, saleslist table to save order & product list with seller.

saleslist table

  mageproduct_id | order_id | seller_id | magequntity(varchar)

  select * from saleslist where  order_id in (36,37)  and mageproduct_id = 2 and seller_id = 20 order by magequantity desc

I am applying above query from below code & this successful return data but not able to sort by magequantity. It's obvious because of VARCHAR datatype.

$trackingcol_saleslist = $this->_objectManager->create('<extesion>\<module>\Model\Saleslist')
                                                    ->getCollection()
                                                    ->addFieldToFilter(
                                                        'mageproduct_id',
                                                        $product_id
                                                    )->addFieldToFilter(
                                                        'order_id',
                                                        ['in' => $order_id_list]
                                                    )->addFieldToFilter(
                                                        'seller_id',
                                                        $sellerId
                                                    )->setOrder('magequantity','DESC');

                                                foreach ($trackingcol_saleslist as $info) {
                                                 print_r($info->getData());
                                                }

I have other option to achieve this like, changing column datatype VARCHAR  to INT or taking $trackingcol_saleslist as array & apply array sorting.

But I am looking for applying CAST & CONVERT Datatype VARCHAR to INT in magento query. Is this possible in magento?


texts: Magento 2 - Add additional text before attribute

texts:
I use this code to display brand attribute value in the product view page:

<referenceContainer name="product.info.main">
    <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.brand" template="product/view/attribute.phtml" before="-">
        <arguments>
            <argument name="at_call" xsi:type="string">getBrand</argument>
            <argument name="at_code" xsi:type="string">brand</argument>
            <argument name="css_class" xsi:type="string">brand</argument>
            <argument name="at_label" xsi:type="string">none</argument>
            <argument name="add_attribute" xsi:type="string">itemprop="brand"</argument>
        </arguments>
    </block>
</referenceContainer>

How I can display Brand text before this attribute value, to be in the product page something like:

Brand: Apple

Thank you


texts: How to create Registration section for Users in Store front in Magento?

texts:
In System->Permissions->Users from Admin Side, the Administrator can create User account for users and assign role. But I want to create a system in Store front to allow users to create account using registration, then the account should be activated by Store Admin.
How to create registration page for Users in Store front side ?
Thanks in advance.


texts: How to solve indexer status "suspended" (n in backlog)


texts: How to make left/right arrow appear only when hovering Magento 2 base image in gallery

texts:
I want to remove left and right arrow when first accessing the product page. By default it was set to appear even when not hovering base image in image gallery. Since it has that overlay effect around the arrows it applies grey overlay which is intrusive.

I'd like those arrows to appear only when hovering base image and not when the page is first loaded. What's weird, if I hover the image and then move cursor away arrows dissapear like they should.


texts:
We're working on importing orders from a legacy system into a Magento 1.9.2.3 store.

We have a script that creates the customer if he doesn't exist and creates the order.

We want to make sure that no emails get sent out from Magento for any of these orders.

We initially setup our script as such

<?php

//Disable all emails
Mage::app()->getConfig()->saveConfig('system/smtp/disable', '1', 'default', 0);

//run import

//Re-enable all emails
Mage::app()->getConfig()->saveConfig('system/smtp/disable', '0', 'default', 0);

?>

We have two concerns with this approach

If a customer places an order during the time that our script is running - they won't get a confirmation
Since Magento now sends the emails through a queue and a cron, if our script is finished by time the cron runs, the emails will still get sent out.

What would be a better way to ensure that no emails get sent out as a result of our importing legacy orders?


texts: Magento 2 custom column sorting not working

texts:
I have created custom column in Sales -> Order UI Grid. I have added "Profit" column. Which is not related to any database table and not the attribute. This column display just calculation of profit.

The issue is I can not sort the column. Column is sortable but it is sorting incorrectly.

I have checked many similar question in stack but nothing helpfull. As the column is not in table and not the attribute.

Following is my override file.

sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="total_paid" class="Company\Module\Ui\Component\Listing\Column\PurchasedPrice">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Profit</item>
                    <item name="sortOrder" xsi:type="number">13</item>
                </item>
            </argument>

        </column>
    </columns>
</listing>


texts:
I moved my website to a new server and :

1- Changed database connection app/etc/env.php

2- Cleared the
    cached files in "/var/cache", "/var/page_cache",
    "var/view_preprocessed","/var/composer_home", "/var/generation"

and i still got the following error:

  Error!: SQLSTATE[HY000] [1045] Access denied for user
  'USER_XXXX'@'localhost' (using password: YES)

Note: USER_XXXX is my old database user not the new one which is in my env file

Edit:

while runing the following commands

/opt/cpanel/ea-php70/root/usr/bin/php bin/magento cache:clean
/opt/cpanel/ea-php70/root/usr/bin/php bin/magento cache:flush

i got the following

  Warning: Uncaught Exception: Warning:
  require(/home/btcegyptgold/public_html/setup/config/application.config.php):
  failed to open stream: No such file or directory in
  /home/btcegyptgold/public_html/vendor/magento/framework/Console/Cli.php
  on line 57 in
  /home/btcegyptgold/public_html/vendor/magento/framework/App/ErrorHandler.php:61
  Stack trace:

  0 /home/btcegyptgold/public_html/vendor/magento/framework/Console/Cli.php(57):
  Magento\Framework\App\ErrorHandler->handler(2, 'require(/home/b...',
  '/home/btcegyptg...', 57, Array)

  1 /home/btcegyptgold/public_html/vendor/magento/framework/Console/Cli.php(57):
  require()

  2 /home/btcegyptgold/public_html/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')

  3 {main}   thrown in /home/btcegyptgold/public_html/vendor/magento/framework/App/ErrorHandler.php
  on line 61


texts: Magento 2 : Error While upgrade 2.3.0 to 2.3.1

texts:
I am trying to upgrade Magento version from 2.3.0 to 2.3.1 and I am using PHP 7.2 for same but while I run upgrade command getting bellow error is anyone have any idea how to fix?

   Parse error: syntax error, unexpected ':', expecting ';' or '{' in /vendor/magento/inventory-composer-installer/src/Plugin.php on line 55

    Warning: Unsupported declare 'strict_types' in /vendor/magento/inventory-composer-installer/src/Plugin.php on line 6

    Parse error: syntax error, unexpected ':', expecting ';' or '{' in /vendor/magento/inventory-composer-installer/src/Plugin.php on line 55


texts: Magento 2. Pass value(for custom field) to UIComponent from XML configuration file

texts:
It is possible to pass value from XML to JS components.

 <field name="postcode" component="Magento_Ui/js/form/element/post-code" formElement="input" sortOrder="70">
            <settings>
                <dataType>text</dataType>
                <visible>true</visible>
                <label translate="true">Zip/Postal Code</label>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
            </settings>
        </field>

For example here we can pass the label. In our case Zip/Postal Code.

I wish to pass a custom field value

For e.g.

...
<settings>
    .....
   <custom_field>Custom Value</custom_field>
   ...
</settings>
...

Also tried by passing it as an attribute for the field node as such

<field custom_field="Custom Value" ....

with no luck. The value is not available in the JS component (in this example Magento_Ui/js/form/element/post-code)

Any ideas on how to achieve this?


texts: How to access magento database in outside

texts: I am working with a project on Magento e-commerce, now I want to access the Magento database in the yii2 framework. anyone help me


texts: Vnecoms Vendor Flate Rate Shipping Carrier with such method not found: vflatrate_test3||19, vendor_multirate

texts:
I am using Vnecoms marketplace and VENDOR MULTIPLE FLATRATE SHIPPING addons for shipping.

https://www.vnecoms.com/magento2-marketplace/plugins/vendor-multi-flatrate-shipping.html

In the Shipping step after selecting shipping methods for the vendor, I'm getting the error as below.

Carrier with such method not found: vflatrate_test3||19, vendor_multirate

Can anyone please help with this?


texts: How to get all orders by orderId in magento

texts:
I want all orders from a particular orderId.

<?php
namespace Racom\Chatbotapi\Model;

use Racom\Chatbotapi\Api\ChatbotapiInterface;

class Chatbotapi implements ChatbotapiInterface
{
    protected $order;

    public function __construct(
        \Magento\Sales\Model\Order $order
    ) {
        $this->order = $order;
    }

    /**
     * Returns the Orders list.
     *
     * @api
     * @param Integer $orderId order Id.
     * @return string Greeting message with users name.
     */
    public function getOrder($orderId)
    {
        $productCollection = $this->order->load($orderId);

        $a = $productCollection->getItems();

        $v = json_encode($a);

        return $v;
    }
}


texts: Different product layout based on product

texts:
What I have tried so far

As the title describes. How can one implement different layouts per product based on a value on that product (in this case a custom EAV on the Product entity)

At first I thought I'd create a custom product type for these type of products. This would work fine. Although you cannot change the product types for existing products.

Then I thought I could make a new page layout, though you can not add content to the product layout.

Lastly I thought I would simply add all these products in a category and change the product view there (via Design > Layout update XML) but this would involve the end user writing XML which is something I'd like to avoid if possible. Same goes for changing the Design > Layout update XML for each product.

Other info:

I have create a Magento module which should replace the product image with a different view. Currently I have overwritten (in my module) the view/frontend/layout/catalog_product_view.xml with my custom content (removing the original image/video blocks and adding my own blocks) this works fine though ALL products now have the new layout.

All products are simple products currently


texts: Magento 2 SKU not showing on Product Page any one have experienced about this issue i'm using custom theme.


texts: How to redirect from an Observer and send a message to the customer

texts:
I am using an Observer to catch that event: controller_action_postdispatch_checkout_onepage_saveBilling

I want that event in order to check the billing address of the customer.

My question is: How can i send a message to the user at this point.When continue button is pressed.

I used the : Mage::getSingleton('core/session')->addError('My message');

but the message is not shown until you refresh the page.And here is the second question.
How can i redirect the page from that point?
I have use with no luck: $this->_redirect('*/*/'); and hardcoded urls with no luck.
Ideally i want when the customer presses the continue button, after some checks that i make, the process to be stopped with a message.The observer is checked and it works as it supposed to work.

Hope it make sense..

EDIT
That's my code.Just to make sure i'm doing it right:
Model/Observer

class Company_Restrictions_Model_Observer {

    public function notifyUser($observer) {
//Lot's off lines are tested here.Nothing seems to work..
//$observer->getRequest()->setParam('return_url','http://www.google.com/');
//Edited after comments
$result = array();
$result['error'] = '-1';
$result['message'] = 'YOUR MESSAGE HERE';
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

}
}

config.xml

<?xml version="1.0"?>

<config>
  <modules>
      <Company_Restrictions>
          <version>0.1.0</version>
      </Company_Restrictions>
  </modules>
  <global>
    <models>
        <company_restrictions>
             <class>Company_Restrictions_Model</class>
        </company_restrictions>
    </models>
    <helpers>
        <company_restrictions>
             <class>Company_Restrictions_Helper</class>
        </company_restrictions>
    </helpers>
    <events>
      <controller_action_postdispatch_checkout_onepage_saveBilling>
        <observers>
          <notify_user>
            <type>singleton</type>
            <class>Company_Restrictions_Model_Observer</class>
            <method>notifyUser</method>
          </notify_user>
        </observers>
      </controller_action_postdispatch_checkout_onepage_saveBilling>
    </events>
  </global>
</config>

EDIT AGAIN
After debuuging i found out that a lot of functions are giving me error.Undefined method ... for ex: _redirect() or Response() or Body().. Does anyone knows why??


texts: Configurable Product Attributes that are Field instead of Dropdown

texts:
I want to use an attribute I created in a configurable product. However, when I attempt to add a configurable product, and pick my attribute set, I get this notice, and this warning.

  Only attributes with scope "Global", input type "Dropdown" and Use To
  Create Configurable Product "Yes" are available.

  This attribute set does not have attributes which we can use for
  configurable product

Why is only Dropdown attributes allowed for configurable products, and is there a way around this. I have an alt sku attribute I want to be shown right under sku. I have been able to get around this by creating the product without the attribute in the attribute set, and then adding the attribute afterwards with no issues, but this is a hack and I'd like something more straight forward. Is there a better way to add this attribute for configurable products?

Also, is the second line really suppose to say

  This attribute set has attributes which we can not use for
  configurable product

That would make more sense, because as is, the language suggests there's not a single attribute it can use. Is that the case?

In general, I feel I'm misunderstanding why I am unable to create my configurable product.


texts: How can I Get Sku In Products Ordered Reports

texts: I want display sku at products ordered reports page, how can i get sku ?


texts: Magento 2 In product page, when display message if stock < 0?

texts: I want to display on the right of "In stock" --> "The delivery time will be 15 days"


texts: order time difference from magento 1 to magento 2 after migration

texts:
I have migrated Magento 1.9.3.1 to Magento 2.3.0

I have setup timezone India Standard Time(Asia/Kolkata).

After migration created_time have differences of 5:30 hours. How can I fix the issue?

For example:

In Magento 1.9 order purchased on: Jun 18, 2019 06:46:43 AM

But In Magento 2.3.0 order purchased_date: Jun 18, 2019 12:16:43 PM


texts: Get notification when customer updates account

texts:
Is it possible to get an email notification to the admin of a magento 2 store whenever a customer changes his account details like address or something?

Is there some kind of hook I can make a module for?


texts:
I need to easily and quickly check if indexing needs to be done.  I have been looking around and have

$process = Mage::getSingleton('index/indexer')->getProcessById();

or

$process = Mage::getSingleton('index/indexer')->getProcessByCode(<process_code>);

Process Name ID Code
Product Attributes 1 catalog_product_attribute
Product Prices 2 catalog_product_price
Catalog URL Rewrites 3 catalog_url
Product Flat Data 4 catalog_product_flat
Category Flat Data 5 catalog_category_flat
Category Products 6 catalog_category_product
Catalog Search Index 7 catalogsearch_stock
Stock Status 8 cataloginventory_stock
Tag Aggregation Data 9 tag_summary

but I need to just quickly get the status.  Is there a better way?


texts: Upgraded to Magento 2.0.14 now many of my pages lost their formatting

texts:
Ubuntu 14.04
Magento 2.0.14

I'm not sure how to call this, but my pages are losing their format after recently completing an update from Magento 2.0.7 to 2.0.14. I updated Magento through the command line. I got no errors during the process. Some pages work (like the home page) and others don't (like the customer and admin logins). Other times it works fine once and then the formatting is gone when I reload the page.

I tried clearing the cache, but since there's no error message I don't even know where to start looking. The pages are still functional; it's just a problem with the formatting.


texts: Admin grid massaction checkboxes default checked & option set to action I want

texts:
Just like the question keep the checkboxes of mass action checked for some items, by default, but I simply want all checkboxes checked by default, plus a default mass-action is selected on first landing.

E.g. a landing grid page:

Should I just use JS to select them? Or need to go through all backend PHP for it?!?


texts: magento 2.3 call updatePrice or reloadPrice on click event

texts:
I've added a checkbox on my product page so when the user clicks on it, the product price gets changed. In order for this to work, the click event should call reloadPrice(), a javascript method defined in Magento_Catalog/js/price-box.js.
ReloadPrice() is called by updatePrice(), another method in Magento_Catalog/js/price-box.js, and updatePrice() is called anytime the user clicks on a swatch or when a custom option is changed.
So what I need is to add a trigger so when my custom checkbox is clicked, the reloadPrice() (or the updatePrice()) is called so that the product price is changed. Is there a way to achieve this?


texts: Magento 2: I need to implement google captcha on checkout page(card payments)

texts:
I need to implement a google captcha on the checkout page(for card payments).
I am having payment transaction failures with fraudulent orders being placed on the website.
Anyone have solutions for the same.
I have searched on google but didn't get any solutions.
There are so many extensions for captcha but not providing the checkout captcha.
If anyone has any idea about Custom functionality that will also work for me.
Please help with the same.
Thanks!!


texts: How to change price all product in Magento 2 by events with value from configuration?

texts:
I don't know how to change the price of all products in Magento 2 by event-observer. I have created a configuration.

** Example:** The value obtained from config is $price, then how do I do?


texts:
In table rate shipping method handling charges are either fixed or percentage of shipping fee. but I want little modification in it. say x is shipping amount as per table rate. y is fixed surcharge and z is tax which is fixed.

So total shipping fee will be x * (1 + y%) * (1 + z%)

How to apply this formula to calculate total shipping charges?


texts: How to create custom php script to display products special price in magento 2?

texts: Can you help me on how to create a php script to display all products with special price including it's sku.


texts: How to enable the ability of using gift cards at check out

texts:
I've been searching on how to add the ability for customers to use gift cards on the check out page on my Magento site and so far no luck. I am running on Magento Enterprise so the function is available for use but where I'm stuck at is where I can enable the function to redeem gift cards. Right now the check out page at the payment gateway only provides the  options of payment either Paypal or credit card options. Could I enable this feature through the Admin Configuration and if so, could you please provide me the path on how?? Or would I need to do something more in-depth than that?

I appreciate the help!


texts:
I created folder < root >/access and here put template files landing page.

Now this landing page is runing from index.html

http://b2bstyle.pl/access/

Ok, looks like everything is ok.

Step 2

Now I go to magento back end --> content and create page

Now I copy all contect from index.html and put in magento back-end

Of course, in this code I changed location to .js and .css and img by add before link, our folder name access/

Ok, now we try open this page we create before in backend:
https://b2bstyle.pl/dostep

But impossible, still loading....

Any solution?


texts:
I can't find a definitive answer to this, but I can see a lot of people are having the same issue.

I have setup magento 2.1.0 and all is going well. However the cron job fails on the update script.

I have the following error:

 [2016-08-26 08:21:02] update-cron.ERROR: Cron readiness check failure!
 Found non-writable paths:  /home/<USER>/public_html/app/design/frontend/Magento [] []

Furthermore this file only exists under the pub/static folder and not under app/design/frontend. Its all very confusing.

I have run the permission changes from magento via ssh, I even tested this with cmod 777 but still to no avail. I have also tried running the cron job as both the user and root but still the same issue.

This is on a VPS running CPanel and WHM PHP version 5.6.24

Am I missing something stupid here or can anyone advise a way to fix this?


texts: Page Title Prefix in single store mode not working

texts: I am using Magento 2.2.5. When I enable single store mode the Page Title Prefix not working. But If I disable single store mode than it's fine. Am I missing something? Thanks.


texts: how to check which patches are installed magento1 when we dont have applied patches.list file

texts:
We have a magento1 store and earlier it was being managed by someone else. We did scanned our website for security patches and scan result shows some patches  are installed , some are not and some has unknown status. We do not have applied.patches.list file so we don't know which patches were installed earlier. Magento version is 1.9.0.1
How do we proceed in this scenario ? Any help will be appreciated


texts:
I used this as my code:

Mage::helper('checkout/cart')->getAddUrl($product)

It gives output of 'url' like this:

http://192.168.0.78/pooja/testmagento/index.php/checkout/cart/add/uenc/aHR0cDovLzE5Mi4xNjguMC43OC9wb29qYS90ZXN0bWFnZW50by9pbmRleC5waHAvYWRtaW4vc3lzdGVtX2NvbmZpZy9lZGl0L3NlY3Rpb24vd2VvX3Byb2R1Y3RsaXN0L2tleS82Y2IzOWRmYTlmMTZkMzEzMzIzN2MzMjJmZjhhYjQ4ZC8,/product/1/form_key/iX6KKIWPRWIdICmy/

Above 'url' is not correct. How can I get correct 'url' for add to cart product?

Thanks.


texts: Using debug extensions / developer mode enough protection

texts:
There are some nice extensions for Magento developers that you usually do not want to have on a live system.

How can you keep them in the project repository but avoid them to be exposed on a live shop?


texts: Rolled back transaction has not been completed correctly while saving product

texts:
We have been facing an issue while saving products & categories at the admin end we are getting Rolled back transaction has not been completed correctly. We are using Magento 2.3.1 EE

Can anyone help me with the steps to resolve this issue?


texts: how to sync or version control the database?

texts:
I've searched around for an answer to this, and didn't yet find one that I either understand or one the actually meets my needs. Maybe the wizards here can help? :)

While at work, I access my magento store which I currently have on my 'test server' running on a hosted server. I have that in git, pushing to bitbucket.

When at home (and wanting to get some extra work done) I pull from bitbucket to my local machine (using sourcetree).

Everything looks to be working fine. However, the million dollar question > I want to work on the same copy (or a copy) of the test sever database. If I add some new test products for example while at work, I want to see those on my home localhost.

How can I link to the remote database then? Links to guides designed for idiots would be greatly appreciated :)


texts: Magento 2.2 some JS files are not loading in production mode

texts:
In Magento 2.2.2 when setting website into production mode the following files are not loading, due to which my store switcher and other ui functions are not working in production mode:

http://website.com/static/frontend/vendor/theme/en_US/jquery/ui.js
http://website.com/static/frontend/vendor/theme/en_US/jquery/validate.js
http://website.com/static/frontend/vendor/theme/en_US/jquery/jquery-storageapi.js

All the CSS and Fonts are loading properly in both production as well as developer mode.

Important:
I was not able to find these js files in developer mode when checked the network tab of inspector.

Can someone tell me where to look for errors?

  Update 1:

I have checked and found that these js file errors are only found in default (pt_BR) Store. When I have checked it for other store(en_US) there were no errors and everything is working fine in this store.

  Update 2:

When I have tried php bin/magento setup:static-content:deploy en_US pt_BR then these js file error occurred in both the stores.

P.S: There is nothing helpful in var logs.


texts: Magento 2 get address extension attribute value in carrier collect rate model

texts:
I successfully pass the extension attribute value to estimate-shipping-method,like this:

etc/extension_attributes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Checkout\Api\Data\ShippingInformationInterface">
        <attribute code="shipping_delivery_date" type="string"/>
    </extension_attributes>
    <extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
        <attribute code="shipping_delivery_date" type="string" />
    </extension_attributes>
</config>

I want to retrieve it in my custom carrier model, but no luck
class MyCarrier extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements
    \Magento\Shipping\Model\Carrier\CarrierInterface
{
    public function collectRates(RateRequest $request)
    {
       $deliveryDate = $request->getExtensionAttributes()->getShippingDeliveryDate();
    }
}


texts: Order mail confirmation generates DOMXPath::query() error

texts:
on order place the email contains the following error and does not display properly

CSS Inline Error: Warning: DOMXPath::query(): Invalid expression in .../vendor/pelago/emogrifier/Classes/Emogrifier.php on line 269

How do I fix this?


texts: I want to create a custom tab on product view page in magento 2

texts:
I want to  create a custom tab on product view page in Magento 2

and inside that tab I want call phtml files of another modules

<referenceBlock name="product.info.details">
    <block class="Magento\Catalog\Block\Product\View" name="product.information.tab" as="productinformation"
        template="product/view/product_details.phtml" group="detailed_info">
        <arguments>
            <argument translate="true" name="title" xsi:type="string">Product Details</argument>
        </arguments>
        <container name="vendor.profile.container" htmlTag="div" htmlClass="vendor-profile-container">
            <container name="vendor.profile.logo.container" htmlTag="div" htmlClass="col-xs-3 vendor-profile-logo">
                <block class="Vnecoms\Vendors\Block\Profile\Logo" name="vendor.profile.logo" template="Vnecoms_Vendors::profile/logo.phtml" />
            </container>
    </block>
</referenceBlock>


texts: Layout Update for All actions of a controller

texts:
I want to write a common update handle for managing few layout updates that apply to all actions of same controller

e.g. I have <checkout_onestep_index> <checkout_onestep_review>, <checkout_onestep_shipping>, etc. is it possible that I can write layout changes for all actions in one single handle like <checkout_onestep_default> OR <checkout_onestep_all>
Here are my common changes for all actions of onestep controller.

    <reference name="head">
        <action method="removeItem"><type>js</type><name>mage/translate.js</name></action>
        <action method="removeItem"><type>js</type><name>quicklogin/tinybox.js</name></action>
        <action method="removeItem"><type>skin_css</type><name>customerlocator/styles.css</name></action>
        <action method="removeItem"><type>js</type><name>mage/directpost.js</name></action>
        <action method="removeItem"><type>js</type><name>mage/centinel.js</name></action>

        <action method="addItem"><type>skin_css</type><name>css/new.checkout.css</name></action>

    </reference>

    <remove name="left"/>
    <remove name="breadcrumbs"/>

    <reference name="header">
        <action method="unsetChildren"></action>
        <action method="setTemplate"><template>checkout/header.phtml</template></action>
        <block type="checkout/cart_sidebar" name="cart_headbar" template="checkout/cart/header.phtml" />
    </reference>

    <reference name="footer">
        <action method="unsetChildren"></action>
        <action method="setTemplate"><template>checkout/footer.phtml</template></action>
    </reference>

Thanks for your help !!!


texts: Cancel order item without cancelling order in magento 2

texts: How to cancel order item without cancelling order in magento 2? Is it possible


texts: unusual Logic behind how order numbers are incrementing

texts:
I'm curious about the logic behind how magento increments it's order numbers, especially regarding orders from different stores within the same website.

We have four stores and have received orders on three of them, all of which are incrementing up from a different point.

Eg.

US store: 100000001

UK store: 1000000001

IE store: 300000001

Is there any logic behind how these numbers start, why would the UK store order numbers begin from 1 billion, the US from 100 million and IE 300 million. I would have thought the UK would be 200 million or something.

Interestingly the first UK order was made less than a minute after an order on the US store.

I should also mention that before going live we deleted some test orders with the SiteClue_Delete_Orders module.

Why are they in a different sequence at all?

Can I edit that order numbers directly in the eav_entity_store table?  Would that effect how Magento connects with our Payment Gateways, Braintree & Paypal?


texts:
I'm a beginner in Magento. Have tried to install it. At first, make a Database "magentotest" with username-> "root" and no password.

The problem I got is when I press continue button it starts loading and reload the current page. Does not go to the next page. Please help.

For my other PHP project I have used alias, at the very beginning I have tried the same, but also that case suffers from the same problem.

Kindly help. My recently Magento unzip file location is "C:\wamp\www\magento\" kindly help. Here is the screenshot.


texts: What features are enterprise and what are free when looking at user guide?

texts:
Is visual merchandiser in magento 2 community edition?

I'm learning magento and while reading documentation trying to find how to do something, I'll see things like visual merchandiser and I'm unable to find that same feature in my 2.2.5 installation by following the instructions.

Is there a way to see what is enterprise only when looking at user docs? Even this doc says "Magento Commerce"


texts: How to send a time-limited coupon code to new subscribers?

texts:
I'm using Mailchimp for newsletter signups. I'm looking for a way to automatically send a coupon code to my new subscribers. I want the coupon to expire after 3 days.
Is there any extension that could help me achieve this?


texts: Set Final Price by javascript (Magento 2)

texts:
I'm playing with some calculations and everything seems ok visually, I could get the price from:

$280.98

And use in my formula, however, I want to change the final price that goes to shopping cart.

Because in my case I can handle everything visually via javascript but when I press Add to Cart button, the amount that goes to shopping cart is not the one I have changed on the tag.

Is there a javascript code that I can reset the final price?


texts: Updating product attribute type programmatically

texts: I have a product attribute that is currently produces varchar(255) as a Type in catalog_product flat tables. How do I change it to being type int(11) programatically? Do I just remove an attribute and re-add it via setup script or there is another way?


texts: Magento2 exam difference between online and onsite proctored?

texts:
I want to know what is the difference between online and onsite proctored exam.

Anyone put light on this.


texts: magento 2.1.5 unable to add product getting mysql error

texts:
i am getting below error while adding product in magento 2.1.5

SELECT `e`.* FROM `catalog_category_entity` AS `e` WHERE (())

  2 exception(s): Exception #0 (Zend_Db_Statement_Exception):
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
  error in your SQL syntax; check the manual that corresponds to your
  MySQL server version for the right syntax to use near '))' at line 1,
  query was: SELECT e.* FROM catalog_category_entity AS e WHERE
  (()) Exception #1 (PDOException): SQLSTATE[42000]: Syntax error or
  access violation: 1064 You have an error in your SQL syntax; check the
  manual that corresponds to your MySQL server version for the right
  syntax to use near '))' at line 1

  Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax
  error or access violation: 1064 You have an error in your SQL syntax;
  check the manual that corresponds to your MySQL server version for the
  right syntax to use near '))' at line 1, query was: SELECT e.* FROM
  catalog_category_entity AS e WHERE (())


texts: Removing all old sales/order and customer data

texts:
We have a Magento v1.4.0.1 store and, yes, we know it is a very old version and would like to upgrade but the contractor that implemented this modified core code. It is tightly coupled with our ExpressionEngine CMS and has been fairly stable for about 3 yrs.

We are going to be implementing a new CMS this year so we may be able to either implement a new version of Magento or another cart but in the mean time, in order to speed up our site, we'd like to be able to archive and then delete old sales/order and customer data.
We'd like to remove all quote/order/payment info from years before 2014 and customer data, including addresses, from customers that have not placed orders since 2014.

Our code authenticates with our ERP through a web service and creates a new Magento customer when they do not exist so we are not worried about customer history because we have their order history in our ERP.

Can this be done using SQL? What queries would I run?


texts:
When I have two items in the cart, I open a second tab where it also shows two items

and now if I add another item then the cart(second tab) will show a total of 3 items.

Now The question is, if I go back to the first tab, how can I see three items in the cart without refreshing the tab.

Auto refresh of the cart:
When I have two items in the cart, I open a second tab where it also shows two items

and now if I add another item then the cart(second tab) will show a total of 3 items.

Now The question is, if I go back to the first tab, how can I see three items in the cart without refreshing the tab.


texts: Magento 2 catalog_product_get_final_price event not working

texts:
I have to set the product price to a custom value depends upon the customer. So I have written an event catalog_product_get_final_price and in the observer, I have set the custom price for the product.

below is my event xml file

    <?xml version="1.0"?>
<!--
/**
 * Pawan_Catalog Module
 *
 * @category    Catalog
 * @package     Pawan_Catalog
 * @author      pawan
 *
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_get_final_price">
        <observer name="setfinalprice" instance="Pawan\Catalog\Observer\FinalPricemanipulation" />
    </event>

</config>

My observer file is

<?php

/**
 * Pawan_Catalog Module
 *
 * @category    checkout
 * @package     Pawan_Catalog
 * @author      pawan
 *
 */

namespace Pawan\Catalog\Observer;

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

class FinalPricemanipulation implements ObserverInterface {

    protected $scopeConfig;
    protected $request;

    public function __construct(
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\App\Request\Http $request
    ) {
        $this->scopeConfig = $scopeConfig;
        $this->request = $request;
    }

    /**
     * Execute observer
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer) {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/observerslogs.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $product = $observer->getEvent()->getProduct();
        $pId = $product->getId();
        $qty = $observer->getEvent()->getQty();
        $actionName = $this->request->getFullActionName();
                $logger->info($actionName);
        if (empty($qty) || ($qty == 1)) {

            $productQuantity = $objectManager->get('Magento\CatalogInventory\Api\StockRegistryInterface')->getStockItem($pId);
//          $logger->info($product->getMeasurementSoldInSize() . "===" . $productQuantity->getMinSaleQty());
            if ($product->getMeasurementSoldInSize() > $productQuantity->getMinSaleQty()) {
                $finalPrice = $product->getData("final_price");
                $finalPrice *= $product->getMeasurementSoldInSize();
                $product->setFinalPrice($finalPrice);
            } elseif ($productQuantity->getMinSaleQty() > 1) {
                $actionName = $this->request->getFullActionName();
                $logger->info($actionName);
                if ($actionName == 'catalog-product-view') {
                    $finalPrice = $product->getData("final_price");
                    $finalPrice *= $productQuantity->getMinSaleQty();
                    $product->setFinalPrice($finalPrice);
                }
            }
        }
        return $this;
    }

}

but is not for view page it working when i add product to cart can any one tell why if anything i did wrong


texts: Viewing a specific category on Magento frontend crashes the site

texts:
I can navigate through my website no problem, add an item to cart, proceed to checkout etc.

The moment I click on the "Accessories" category we have set up, the website freezes, and then I can no longer access the site on that browser for a good hour or so.

If I change browser, I can view the website fine, but then if I click on 'Accessories' again, it freezes up.

How can I resolve this?


texts: paypal express checkout stop redirecting to paypal site

texts: The problem is i need to stop redirecting to paypal after the selecting the payment method as paypal because it was missing the order review step so i want this to come to order review step and accept terms and condition and then redirect to paypal. So please help me to solve this issue i am using magento 1.7


texts: Magento 2 extending product form hide fieldset

texts:
I have extended product form functionality by using product_form.xml in the added fieldset. now I have to hide that fieldset on a particular condition, like on module disable.

I know about the modifierPool from there I can hide that field by putting a condition in.

But is there any way to do it in XML like dependsOnConfig as we are using in menu.xml?


texts: Attributes showing product´s actual price

texts:
I would like to create a product, that is customizable by weight (for example: loose tea).
The variants of the attribute "weight"(e.g. 100 grams / 500 grams etc.), should show the weight´s actual price and not the additive price as it would be common for configurable products.

Here you will find two examples (I´m sorry, only in German - just choose the Drop Down attribute "Gewicht" on the first page / Radio Buttons on the second):

http://www.krauterie.de/kraeuter-fuer-pferde/gelenke-pferd/spat-arthrose-kraeuter1.html
[--Choose Attribute "Gewicht" at Drop Down]

http://www.meine-teemischung.de/tee-blueten-8/kamille-flores-chamomillae-172
[---Radio Buttons!]


texts: Change localhost URL of magento to access it globally

texts:
I need to change my localhost url http://localhost:1338/magento2

to abc.mycompany.com.

So my URL is accessible globally ie outside my localhost

Final URL should be:

abc.mycompany.com/magento2

1) I tried changing in core_config_data web/unsecure/base_url and web/secure/base_url to abc.mycompany.com/magento2

2) Added 127.0.0.1 abc.mycompany.com in C:\Windows\System32\drivers\etc\hosts

But my site is not loading.

Pls suggest.


texts: How to update a admin layout after creating Grid in custom module?

texts:
I have created new Grid in custom module. But when it use it displays following error.

  Fatal error: Class 'XX_YY_Block_Adminhtml_Display' not found in C:\xampp\htdocs\xx\app\code\core\Mage\Core\Model\Layout.php on line 491

**
I found some articles and it mentions to update layout.xml. But I could't found layout.xml. How to solve this problem

enter preformatted text here


texts: Access Magento API through localhost to avoid network latency

texts:
I have a Magento site and an external app that communicates with it via the Magento API. For the moment, the second app is hosted in the same server as the Magento installation. The Magento API can be very slow, and I think the fact that an API call has to be resolved in a DNS server (the request must go out of the network and then come back to the same server) has something to do with it.

Is there a way that I can use a different url (http://localhost) to tell the second app that it is a local request and maybe reduce response time? I cannot change base_url or the site would stop working.


texts: Set attribute for customer registration form on frontend

texts:
I use this code to set the "promotion code " attribute but in some way this attribute is aviable only from admin panel.
This is the code :

<?php
namespace Riccardo\Plugin\Setup;

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

class InstallData implements InstallDataInterface
{
    /**
     * Customer setup factory
     *
     * @var \Magento\Customer\Setup\CustomerSetupFactory
     */
    private $customerSetupFactory;
    /**
     * Init
     *
     * @param \Magento\Customer\Setup\CustomerSetupFactory $customerSetupFactory
     */
    public function __construct(\Magento\Customer\Setup\CustomerSetupFactory $customerSetupFactory)
    {
        $this->customerSetupFactory = $customerSetupFactory;
    }
    /**
     * Installs DB schema for a module
     *
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     * @return void
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {

        $installer = $setup;
        $installer->startSetup();

        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
        $entityTypeId = $customerSetup->getEntityTypeId(\Magento\Customer\Model\Customer::ENTITY);
        $customerSetup->removeAttribute(\Magento\Customer\Model\Customer::ENTITY, "promotion_code");

        $customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, "promotion_code",  array(
            "type"     => "varchar",
            "backend"  => "",
            "label"    => "Promotion Code",
            "input"    => "text",
            "source"   => "",
            "visible"  => true,
            "required" => false,
            "default" => "",
            "frontend" => "Promotion Code",
            "unique"     => false,
            "note"       => ""

        ));

        $promotion_code   = $customerSetup->getAttribute(\Magento\Customer\Model\Customer::ENTITY, "promotion_code");

        $promotion_code = $customerSetup->getEavConfig()->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'promotion_code');

        $used_in_forms[]="adminhtml_customer";
        $used_in_forms[]="checkout_register";
        $used_in_forms[]="customer_account_create";
        $used_in_forms[]="customer_account_edit";
        $used_in_forms[]="adminhtml_checkout";
        $promotion_code->setData("used_in_forms", $used_in_forms)
            ->setData("is_used_for_customer_segment", true)
            ->setData("is_system", 0)
            ->setData("is_user_defined", 1)
            ->setData("is_visible", 1)
            ->setData("sort_order", 100);

        $promotion_code->save();

        $installer->endSetup();
    }
}

What's option I need to set the attribute for all forms, admin and frontend?


texts: Magento 2.3 REST API: How to update shipment?

texts:
I need to add carrier code and tracking number to the shipment by REST API.

For this, I am trying 2 different codes which I found from the search as below. But it doesn't update anything, not display any error and return the same array.

I don't know what should be order_id, parent_id and entity_id. I am using different ids from the order and shipment URL.

$shiptrack = [
"entity" => [
"order_id" => 6298,
"parent_id" => 6298,
"entity_id" => 12594,
"weight"=> 0,
"qty"=> 0,
"description"=> "Tracking code Description",
"track_number"=> "1234567",
"title"=> "Custom Tracking Code",
"carrier_code"=> "custom"
]
];

2.Tried all ids from the order and shipment URL.

$shiptrack = [
"items"=> [
        [
            "order_item_id"=>5813,
            "qty"=> 0
        ]
    ],
"notify" => true,
"appendComment" => true,
"comment" => [
    "extension_attributes" => [],
    "comment" => "Item(s) has been shipped",
    "is_visible_on_front" => 0
], "tracks" => [
        [
            "extension_attributes" => [],
            "track_number" => $trackingNumber,
            "title" => $shipTitle,
            "carrier_code" => $carrierCode
        ]
    ]
];


texts: Magento 2: how to delete orders from the database

texts:
How can I delete the test orders created in my store?
I have opened the database but I couldn't find the order table.
Please help me to delete the orders.
I'm using the later version of Magento 2.


texts: Template file isn't inheriting from my block extending Mage_Core_Block_Template?

texts:
I have created a module where I can add images in the admin and then they will be displayed in the front-end in the form of a banner slider.

all of my admin stuff is working fine it adds images etc etc, so I created a block (/app/code/local/Nublue/Slidemanager/Block/bannerslider.php) which consists of the following:

public function CreateSliderHtml()
{
    $html = '';
    $slideimage = Mage::getModel('nublue_slidemanager/slideimage');
    foreach ($slideimage as $slide) {
        $image = $slide->getImage();
        if ($slide->getUrl() != null || '') {
            $url = $slide->getUrl();
        }
    $html .= '

'
    }
    return $html;
}

}

and my class is called 'Nublue_Slidemanager_Block_bannerslider' and it extends 'Mage_Core_Block_Template'

in my template file

(app/design/frontend/base/default/template/Nublue_Slidemanager/bannerslider.phtml)

I have this:

                    <?php echo $this->CreateSliderHtml(); ?>

but the echo $this->CreateSliderHtml(); gives an error

Invalid method Mage_Core_Block_Template::CreateSliderHtml(Array
(
)
)

and I know the template file is being called because if I remove the php code from the template and hardcode some images then they show up.

Is there an xml file I need to edit somewhere? I thought as long as I defined where I was getting blocks and helpers and things from it would work. So to clarify I do have Nublue_Slidemanager.xml and config.xml in their correct folders


texts: Magento - Discount price including tax/vat

texts:
A client requested that discounts displayed in the shopping cart should be shown including tax/vat. The relevant tax settings at the time were:

Apply Customer Tax: After Discount
Apply Discount on Prices: Excluding Tax

We subsequently changed these to...

Apply Customer Tax: Before Discount
Apply Discount on Prices: Including Tax

....but whilst the discount is now shown including tax/vat, the tax/vat amount is now displayed without taking the discount into account.

The settings that I thought would give us what we want are:

Apply Customer Tax: After Discount
Apply Discount on Prices: Including Tax

....but whilst this shows the discount including tax/vat, the grand total and vat figures are now incorrect and I receive following warning message (despite the settings not being ones which should generate the warning according to http://www.magentocommerce.com/knowledge-base/entry/magento-ce-18-ee-113-tax-calc):

  Warning tax discount configuration might result in different discounts than a customer might expect

I've now established that the tax/vat figure is incorrect with these settings because when calculating product tax/vat it is first subtracting the GROSS discount, rather than net. In other words it looks as though changing the 'Apply Discount on Prices' setting not only affects the display of discount, but also the internal calculations.

How is it possible to get discounted prices to show including tax/vat AND for tax/vat to be shown correctly based on discounted values?

[On an Enterprise 1.13.0.2 installation. Tax Calculation Method Based On -> Unit Price,  Catalog Prices -> excluding tax]


texts: Magento 2 custom logger 'Missing required argument $name'

texts:
I'm trying to create a custom logger, so I can log to a custom log file.

I've looked at and followed multiple tutorials that all say the same, however I keep getting the same error.

Tutorials that I followed:

http://www.thienphucvx.com/magento-2-logging-to-a-custom-file/
https://www.maximehuran.fr/en/logs-and-magento-2/
https://ranasohel.me/2016/06/26/how-to-create-a-custom-logger-in-magento-2/
How to create custom Log file in Magento 2?

This is not a duplicate of How to create custom Log file in Magento 2? as I followed everything that was explained there but got this error regardless.

I keep receiving the error: Missing required argument $name of Burst\MageNinjaApi\Logger\Logger., but far as I am aware, I am supplying the argument $name with <argument name="name" xsi:type="string">MageNinjaApiLogger</argument> in etc/di.xml.

Magento version: 2.1.10

app/code/Burst/MageNinjaApi/etc/di.xml

<?xml version="1.0" ?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Burst\MageNinjaApi\Catalog\Api\ProductRepositoryInterface" type="Burst\MageNinjaApi\Catalog\ProductRepository" />
    <preference for="Burst\MageNinjaApi\Quote\Api\GuestCartItemRepositoryInterface" type="Burst\MageNinjaApi\Quote\GuestCartItemRepository" />
    <preference for="Burst\MageNinjaApi\Quote\Api\Data\CartItemInterface" type="Burst\MageNinjaApi\Quote\Item" />

    <!-- Custom Logger -->
    <type name="Burst\MageNinjaApi\Logger\Handler\Debug">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Burst\MageNinjaApi\Logger\Logger">
        <arguments>
            <argument name="name" xsi:type="string">MageNinjaApiLogger</argument>
            <argument name="handlers" xsi:type="array">
                <item name="debug" xsi:type="object">Burst\MageNinjaApi\Logger\Handler\Debug</item>
            </argument>
        </arguments>
    </type>
</config>

app/code/Burst/MageNinjaApi/Logger/Logger.php

<?php

namespace Burst\MageNinjaApi\Logger;

class Logger extends \Monolog\Logger {

}

app/code/Burst/MageNinjaApi/Logger/Handler/Debug.php

<?php

namespace Burst\MageNinjaApi\Logger\Handler;

use Magento\Framework\Logger\Handler\Base;
use Monolog\Logger;

class Debug extends Base {
  protected $fileName = '/var/log/MageNinjaApi/debug.log';
  protected $loggerType = Logger::DEBUG;
}


texts: Select orders based on number of adults and children

texts: I am trying to develop a website for travel agency, I wanted to know is there a option to provide the user with number of adults and number of children. Where the price for children is lesser than for adults.


texts: Create Product Attribute Of Type MULTISELECT or dropdown select & Create Option Labels Diffrent for Diffrent Store using install or upgrade schema

texts:
I am creating custom Product Attribute Of type MULTI SELECT,

I want to create different option label for each stores for this particular Attribute,

I have tried with this below code,

$eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'myattribute',
            [
                'type' => 'text',
                'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
                'frontend' => '',
                'label' => 'My Attribute',
                'input' => 'multiselect',
                'class' => '',
                'option' => ['values' =>
                                [
                                    '0' => '1',
                                    '1' => '2',
                                    '2' => '3',
                                    '3' => '4',
                                    '4' => '5',
                                    '5' => '6',
                                ],
                            ],  // I have tried this way but not working
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'visible' => true,
                'required' => false,
                'user_defined' => true,
                'default' => '',
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'wysiwyg_enabled' => true,
                'unique' => false,
                'apply_to' => ''
            ]
        );

With the above code, Attribute Options were inserted as a new row & I want it to be stored as store wise.

How can I achieve this thing.?


texts:
I would hide the money to those who are not registered but can not find the file phtml.

Some help?

P.S. I found only price_clone.phtml but when i try to change it, nothing happens.


texts: How to add menu SALE with submenus which will show only products on sale?

texts:
I am using Magento 2.3.2. I have a menu which is called SALE on my website. At the moment when you click on it, it shows all the product which are on sale. Is there a way to add sub-menus to it? For example:

  SALE -> Women | Men | Kids

and when you click on the respective category, to display only the products which are on sale from this category?


texts: I suddenly started getting this error when i run api on postman.Can anyone help me?


texts:
Can you help me please with setting storeview, because I have two storeview: Privat and Clients, I need for storeview Privat entrance access through a password, how to do?

Thanks


texts: Magento 2 Gift text message module not working

texts:
How to enable and show the Gift message module on product detail pages in Magento 2.3.1.

Thanks