import – Trouble importing orders with Amasty extension

I’m trying to use the Amasty order import/export plugin. I can get the data to validate, but on import it throws this error:


Uncaught Error: Call to a member function getAdditionalInformation() on null in
/public_html/vendor/magento/module-sales/Model/OrderRepository.php:189 Stack trace: #0
/public_html/vendor/magento/module-sales/Model/OrderRepository.php(224):
MagentoSalesModelOrderRepository->setPaymentAdditionalInfo() #1
/public_html/vendor/magento/framework/Interception/Interceptor.php(58):
MagentoSalesModelOrderRepository->getList() #2
/public_html/vendor/magento/framework/Interception/Interceptor.php(138):
MagentoSalesModelOrderRepositoryInterceptor->___callParent() #3
/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
MagentoSalesModelOrderRepositoryInterceptor->MagentoFrameworkInterception{closure}() #4
/fnbeuuvknf/public_html/generated/code/Magento/Sale

When I check the DB, it adds a row with the correct data to the sales_order table, but doesn’t add anything to the sales_order_grid table.

Based on this info, is there anything I’m missing?

Thanks

magento2 – Magento 2 : Change Order # Formatting for M2 Orders

I am trying to implement feature that Orders placed on M2 should start with a ‘ 3 ‘ instead of a ‘ 2 ‘

This will help me with easily identifying new orders while we move test orders to production and for post live tracking.

What would be the most convenient method to do so programmatically, following by best practice ?

magento2 – Magento 2 REST get all Orders with admin token. CustomerID?

When I try to get all orders of my store…

Similar to this one: Magento2: REST API GET all Orders

I receive this message:

message: Does not exist the entity with %fieldName = %fieldValue",
    "parameters": {
        "fieldName": "customerId",
        "fieldValue": null
    }
}

How I get all orders??

magento 1.9 – Display number of orders per customer in admin order view

I’m trying to display number of orders made per customer in admin order grid, using the following join and select I could get the number or orders.

$collection->getSelect()->joinLeft(‘sales_flat_order’,
‘main_table.increment_id =
sales_flat_order.increment_id’,’sales_flat_order.customer_email’);
$readAdapter =
Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’);
$select = $readAdapter->select() ->from(‘sales_flat_order’)
->columns(array(‘orders_count’ => new Zend_Db_Expr(‘COUNT(*)’))) ->group(‘sales_flat_order.customer_email’);

$collection->getSelect()->joinLeft( array(‘orders_count’ => new
Zend_Db_Expr(‘(‘.$select.’)’)), ‘sales_flat_order.customer_email =
orders_count.customer_email’, array(‘orders_count.orders_count’));
$collection->addFilterToMap(‘orders_count’, ‘orders_count.orders_count’);

this is the result >>

increment_id  count_orders  email  
1000001       3             customer@customer.com  
1000008       3             customer@customer.com 
1000015       3             customer@customer.com

how could I get sum of orders at time of every order, not sum of all orders

increment_id  count_orders  email 
1000001       1             customer@customer.com 
1000008       2             customer@customer.com 
1000015       3             customer@customer.com

magento 1.9 – how to get number of orders made per customer in admin order grid

I am trying to display number of orders made per customer (customer is identified by email) in admin order grid. Number of orders should be the sum of orders made per customer, regardless if customer is buying as a quest, or registered user.
expected result should be like

increment_id count_orders email
1000001      1            customer@customer.com
1000008      2            customer@customer.com
1000015      3            customer@customer.com

not like this

increment_id count_orders email
1000001      3            customer@customer.com
1000008      3            customer@customer.com
1000015      3            customer@customer.com

What is the best approach to achieve this ?

Thank you!

PayPal Orders Not Triggering New Order Emails, Magento 1.14.3.10

When receiving orders via PayPal Express checkout the customers are not receiving a new order email. The new order emails work correctly when orders are paid via Sagepay. Currently having to go into each PayPal order and click the “Send Email” button, otherwise the customer won’t receive the new order email. Any idea what I could check or change to correct this issue?

Magento2: How to change order status for COD orders

Currently

  • when customer pay order in advance example in paypal I have order status "paid".
  • when customer try pay for order in advance example via paypal but payment refused I have order status "pending".
  • But when customer select payment method "Cash on Delivery" I also have order status "pending".

How to set:
When customer select payment method "cash on delivery" then default status order is "COD".

orders – Add column and button magento 2

Is there any way to add a button and column at the backend order view items renderer?
I have tried multiples solution but did not work.

sales_order_view

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body>
    <referenceBlock name="order_items">
        <arguments>
            <argument name="columns" xsi:type="array">
                <item name="inventory_source" xsi:type="string" translate="true">Source</item>
            </argument>
        </arguments>
        <referenceBlock name="default_order_items_renderer">
            <arguments>
                <argument name="columns" xsi:type="array">
                    <item name="inventory_source" xsi:type="string" translate="true">col-source</item>
                </argument>
            </arguments>
        </referenceBlock>

        <block class="MagentoSalesBlockAdminhtmlItemsColumnDefaultColumn" name="inventory_source"
               template="Test_DropShipping::order/items/source.phtml" group="column"/>
    </referenceBlock>
</body>

phtml file:

<?= $block->escapeHtml(__('Link to Product')) ?>
<?php if ($_item = $block->getItem()): ?>
<div class="product-source">
    <?= $block->escapeHtml(__('Link to Product')) ?>
</div>

enter image description here

How to prevent duplicate orders placed in woocommerce within a limited time

In my woocommerce site, client had placed same order multiple times,I surprised, woocommerce dont have a duplicate order trigger in the system.

Is there any way, i can prevent duplicate orders(orders with same products from the same customer and variation is okay) within a specified time(like 5 minutes or 10) in future ?

Thanks guys

equation solving – Solve[] arbitrarily adding orders of magnitude which cancel?

Define the variables

m0 = .1349766;
mp = .13957018;
mX = (2 mp + 3 m0)/2;

Now suppose we wish to solve the following equation for equation Ep:

sols = Solve((2 E0 Ep - 4 (E0 + Ep) mX + 4 mX^2 + m0^2)/(Sqrt(Ep^2 - mp^2) Sqrt(E0^2 - m0^2)) == 1, Ep)

Then, Mathematica returns

{{Ep -> (1.07446*10^47 + E0 (-4.59436*10^47 + 4.42011*10^47 E0) -  0.5 Sqrt(-3.79456*10^92 + E0 (2.32699*10^93 + E0 (1.73795*10^94 + E0 (-1.27726*10^95 + 1.89274*10^95 E0)))))/(3.05309*10^47 + E0 (-8.84022*10^47 + 4.84611*10^47 E0))}, 
{Ep -> (1.07446*10^47 + E0 (-4.59436*10^47 + 4.42011*10^47 E0) + 0.5 Sqrt(-3.79456*10^92 + E0 (2.32699*10^93 + E0 (1.73795*10^94 + E0 (-1.27726*10^95 + 1.89274*10^95 E0)))))/(3.05309*10^47 + E0 (-8.84022*10^47 + 4.84611*10^47 E0))}}

which is fine, I guess. But, as you can see, it’s introduced a bunch of factors of $10^{47}$ which cancel everywhere. This seems to me to be totally meaningless and a huge hassle especially since none of my parameters are even remotely close to $10^{47}$, and FullSimplify doesn’t cancel the common factors for some reason.

So I guess my question is, how do I get Mathematica to stop introducing arbitrary factors of huge numbers in Solve()?