magento订单号码及前缀的修改

magento订单号码及前缀的修改涉及到一个数据表

 eav_entity_store

其中increment_prefix是前缀,正常是1,
increment_last_id是最后一个订单的号码,它的第一个字母2是前缀,记得一起改

5 order
6 invoice 
8  shipment
对应的不同的类别,数据表在 eav_entity_type 中
 

magento后台订单无法显示用户选择的custom option的内容

magento的一些产品,让用户选择size或color时,是通过生成一个简单产品,然后在custom opiton中定义相应的选项让用户选择,
但奇怪的是一些情况下后台订单无法显示用户选择的custom option的内容,然后在前台,用用户的帐户登录,却可以。
解决办法录下:
app/design/adminhtml/default/default/template/sales/items/column/name.phtml
找到                  
         $_option = $this->getFormattedOption($_option['value']);    (这名让$_option变成了NULL)
在其前面放上以下代码,即可
         echo $this->getCustomizedOptionValue($_option);

解决!!

magento在改版网站时如何迁移客户和订单数据

magento在改版网站时,需在另外一个模拟站,进行网站的改版和调试,当改好时,如何将自在运营中的magento的客户和订单数据迁移新站呢,以我把我订单和客户所涉及的数据库罗列如下,我试运了,没问题。
订单:
 mysqldump -u用户 -p密码  magento数据库 sales_bestsellers_aggregated_daily sales_bestsellers_aggregated_monthly sales_bestsellers_aggregated_yearly sales_billing_agreement sales_billing_agreement_order sales_flat_creditmemo sales_flat_creditmemo_comment sales_flat_creditmemo_grid sales_flat_creditmemo_item sales_flat_invoice sales_flat_invoice_comment sales_flat_invoice_grid sales_flat_invoice_item sales_flat_order sales_flat_order_address sales_flat_order_grid sales_flat_order_item sales_flat_order_payment sales_flat_order_status_history sales_flat_quote sales_flat_quote_address sales_flat_quote_address_item sales_flat_quote_item sales_flat_quote_item_option sales_flat_quote_payment sales_flat_quote_shipping_rate sales_flat_shipment sales_flat_shipment_comment sales_flat_shipment_grid sales_flat_shipment_item sales_flat_shipment_track sales_invoiced_aggregated sales_invoiced_aggregated_order sales_order_aggregated_created sales_order_status sales_order_status_label sales_order_status_state sales_order_tax sales_payment_transaction sales_recurring_profile sales_recurring_profile_order sales_refunded_aggregated sales_refunded_aggregated_order sales_shipping_aggregated sales_shipping_aggregated_order salesrule salesrule_coupon salesrule_coupon_usage salesrule_customer salesrule_label salesrule_product_attribute wishlist eav_entity_store>order.sql

eav_entity_store 是记录了订单的一些最后一个Id号资料,这个不拷,会在支付最后一步出错的!

客户
 mysqldump -u用户 -p密码  magento数据库 customer_address_entity customer_address_entity_datetime customer_address_entity_decimal customer_address_entity_int customer_address_entity_text customer_address_entity_varchar customer_eav_attribute customer_eav_attribute_website customer_entity customer_entity_datetime customer_entity_decimal customer_entity_int customer_entity_text customer_entity_varchar customer_form_attribute customer_group log_customer>custom.sql

将上述运营站导出的表,导入到新版的站中,即可实现客户和订单的迁移.

用C#通过ebay api的GetOrders获取订单的示范代码

关天getorders的功能的官方说明

http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetOrders.html

web的引用地址:http://developer.ebay.com/webservices/latest/eBaySvc.wsdl

另外一个vb.net的getorders示范代码https://ebay.custhelp.com/app/answers/detail/a_id/505/~/getorders-sample-in-vb.net-using-ebay-sdk-v459.0-for-.net

using eBay.Service.Call;
using eBay.Service.Core.Sdk;
using eBay.Service.Util;
using eBay.Service.Core.Soap;

namespace Trading_Samples
{
public class OrderManagement
{
//GetOrders
private void GetOrders()
{
//create the context
ApiContext context = new ApiContext();

//set the User token
context.ApiCredential.eBayToken = “Your token”;

//set the server url
context.SoapApiServerUrl = “https://api.sandbox.ebay.com/wsapi”;

//enable logging
context.ApiLogManager = new ApiLogManager();
context.ApiLogManager.ApiLoggerList.Add(new FileLogger(“log.txt”, true, true, true));
context.ApiLogManager.EnableLogging = true;

//set the version
context.Version = “705”;
context.Site = SiteCodeType.UK;
bool blnHasMore = true;

DateTime CreateTimeFromPrev, CreateTimeFrom, CreateTimeTo;

GetOrdersCall getOrders = new GetOrdersCall(context);
getOrders.DetailLevelList = new DetailLevelCodeTypeCollection();
getOrders.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);

//CreateTimeTo set to the current time
CreateTimeTo = DateTime.Now.ToUniversalTime();

//Assumption call is made every 15 sec. So CreateTimeFrom of last call was 15 mins
//prior to now
TimeSpan ts1 = new TimeSpan(9000000000);
CreateTimeFromPrev = CreateTimeTo.Subtract(ts1);

//Set the CreateTimeFrom the last time you made the call minus 2 minutes
TimeSpan ts2 = new TimeSpan(1200000000);
CreateTimeFrom = CreateTimeFromPrev.Subtract(ts2);

getOrders.CreateTimeFrom = CreateTimeFrom;
getOrders.CreateTimeTo = CreateTimeTo;

getOrders.Execute();

if (getOrders.ApiResponse.Ack != AckCodeType.Failure)
{
//Check if any orders are returned
if (getOrders.ApiResponse.OrderArray.Count != 0)
{
foreach (OrderType order in getOrders.ApiResponse.OrderArray)
{
//Update your system with the order information.
Console.WriteLine(“Order Number: ” + order.OrderID);
Console.WriteLine(“OrderStatus: ” + order.OrderStatus);
Console.WriteLine(“Order Created On: ” + order.CreatedTime);

//Get Order Details
TransactionTypeCollection orderTrans = order.TransactionArray;

//Order could be comprised of one or more items
foreach (TransactionType transaction in orderTrans)
{
Console.WriteLine(“Order for: ” + transaction.Item.ItemID + “, ” + transaction.Item.SKU + “, ” + transaction.Item.Title);

//If you are listing variation items, you will need to retrieve the variation
//details as chosen by the buyer
if (transaction.Variation.SKU != null)
{
Console.WriteLine(“Variation: ” + transaction.Variation.SKU);
}
Console.WriteLine(“OrderLineItemID: ” + transaction.OrderLineItemID);
Console.WriteLine(“Qty Purchased: ” + transaction.QuantityPurchased);
Console.WriteLine(“Buyer Info: ” + order.BuyerUserID + “, ” + transaction.Buyer.Email);

}

if (order.CheckoutStatus.Status == CompleteStatusCodeType.Complete)
{
//Get Payment Details
Console.WriteLine(“Order Adjustment Amount: ” + order.AdjustmentAmount.Value);
Console.WriteLine(“Order Amount Paid: ” + order.AmountPaid.Value);
Console.WriteLine(“Payment Method: ” + order.CheckoutStatus.PaymentMethod);

ExternalTransactionTypeCollection extTrans = order.ExternalTransaction;

foreach(ExternalTransactionType extTran in extTrans)
{
Console.WriteLine(“External TransactionID: ” + extTran.ExternalTransactionID);
Console.WriteLine(“External Transaction Time: ” + extTran.ExternalTransactionTime);
Console.WriteLine(“Payment/Refund Amount: ” + extTran.PaymentOrRefundAmount.Value);
}

//Get shipping information
ShippingServiceOptionsType shipping;
shipping = order.ShippingServiceSelected;

Console.WriteLine(“Shipping Service Selected: ” + order.ShippingServiceSelected.ShippingService);

//Get Shipping Address – Address subject to change if the buyer has not completed checkout
AddressType address = order.ShippingAddress;

StringBuilder sAdd = new StringBuilder();
sAdd = sAdd.Append(address.Name);
if (address.Street != null && address.Street != “”)
sAdd.Append(“, ” + address.Street);
if (address.Street1 != null && address.Street1 != “”)
sAdd.Append(“, ” + address.Street1);
if (address.Street2 != null && address.Street2 != “”)
sAdd.Append(“, ” + address.Street2);
if (address.CityName != null && address.CityName != “”)
sAdd.Append(“, ” + address.CityName);
if (address.StateOrProvince != null && address.StateOrProvince != “”)
sAdd.Append(“, ” + address.StateOrProvince);
if (address.PostalCode != null && address.PostalCode != “”)
sAdd.Append(“, ” + address.PostalCode);
if (address.CountryName != null && address.CountryName != “”)
sAdd.Append(“, ” + address.CountryName);
if (address.Phone != null && address.Phone != “”)
sAdd.Append(“: Phone” + address.Phone);

Console.WriteLine(“Shipping Address: ” + sAdd);

double salesTax;
//Get the sales tax
if (order.ShippingDetails.SalesTax.SalesTaxAmount == null)
salesTax = 0.00;
else
salesTax = order.ShippingDetails.SalesTax.SalesTaxAmount.Value;

Console.WriteLine(“Sales Tax: ” + salesTax);

if (order.BuyerCheckoutMessage != null)
{
Console.WriteLine(“Buyer Checkout Message: ” + order.BuyerCheckoutMessage);
}

}
Console.WriteLine(“********************************************************”);
}
}
}

}
}
}

ebay的Trading API 705以上的版本,该如何获取订单交易信息

原先您需要通过GetItemTransactionsGetSellerTransactions来获取transaction信息,并将IncludeContainingOrder设置为true来查看是否有合并订单的情况。然后通过OrderID再次调用GetOrders来查看合并后的订单信息。

从Trading API 705版本后,GetOrders被增强了。您将可以跳过呼叫GetItemTransactionsGetSellerTransactions的步骤,直接使用GetOrders来查看近期成交的交易,并同时获取被合并的订单。

例如:获取某段时间内的订单信息:

<GetOrdersRequest xmlns=”urn:ebay:apis:eBLBaseComponents”>

<CreateTimeFrom>2010-12-01T20:34:44.000Z</CreateTimeFrom>

<CreateTimeTo>2011-02-28T20:34:44.000Z</CreateTimeTo>

<OrderRole>Seller</OrderRole>

<RequesterCredentials>

<eBayAuthToken>TOKEN</eBayAuthToken>

</RequesterCredentials>

</GetOrdersRequest>
另外,在返回的response中,增加了OrderLineItemID字段,这个字段由itemID-TransactionID组成,是一个全局唯一的变量。

您可以通过在使用GetOrders时,将该字段传入OrderID来获取某个transaction的详细信息。

例如,获取itemID为110586452612,交易号为631538694001的交易信息:

<GetOrdersRequest xmlns=”urn:ebay:apis:eBLBaseComponents”>

<OrderIDArray>

<OrderID>110586452612-631538694001</OrderID>

</OrderIDArray>

<OrderRole>Seller</OrderRole>

<RequesterCredentials>

<eBayAuthToken>TOKEN</eBayAuthToken>

</RequesterCredentials>

</GetOrdersRequest>

zencart gspay支付返回后出现There has been an error processing your credit card. Please try again的错误

gspay支付返回后出现

www.abc.com/ndex.php?main_page=checkout_payment&error_message=mainThere has been an error processing your credit card. Please try again的错误,后台订单不会生成.

解决办法是在includes\module\payment\gspay.php中找MODULE_PAYMENT_GSPAY_TEXT_ERROR_MESSAGE,然后将这行注释掉即可.