Paypal网站付款标准结账的正确发货POST变量是什么?
我花了很多时间来运送Paypal网站付款标准结账.实际上我也在使用IPN,但这与此无关,这是关于从我的购物车中获取运费和手续费以显示在paypal结账并更换paypal运费计算器.
我发现的事情:
所以我希望能帮助后来的人.而且我希望Paypal能够在文档中共同行动,这对我来说完全是浪费时间.
但除此之外 - 是否有更好的方式来进行运输?如果不是"运输"而不是"shipping_cart",该变量应该被称为什么?在任何地方都有最新的文档吗?
基本上我想要做的是在结帐页面上,我试图将 USPS 的“First-Class Mail Parcel”更改为“First-Class Mail Parcel(3-5 个工作日)”,“Priority Mail”更改为“优先邮件(2-3 个工作日)”和“特快专递”到“特快专递(下一工作日)”。
已经尝试使用以下链接中建议的 translate.csv 解决方案。出于某种原因,它只更改了 UPS 文本,而使 USPS 保持不变。
如何在注册和结帐过程中更改 magento 中的“运输信息”标签
还尝试通过管理面板使用内联翻译,但无法使其正常工作。反正讨厌那个功能。每当您移动鼠标时,这本书都会不断移动,这使得点击框变得非常困难。
必须有一种方法来改变这一点......任何帮助将不胜感激。现在已经在谷歌和论坛上搜索了几个小时,以获得这样一个看似简单的解决方案。
Aramex Rate计算器API返回错误代码ISE01
和以下错误消息:
在请求时获取计算率时发生内部服务器错误
这个错误的原因是什么?
以下是Aramex费率计算器API的示例代码:
<?php
$params = array(
'ClientInfo' => array(
'AccountCountryCode' => 'JO',
'AccountEntity' => 'AMM',
'AccountNumber' => '00000',
'AccountPin' => '000000',
'UserName' => 'user@company.com',
'Password' => '000000000',
'Version' => 'v1.0'
),
'Transaction' => array(
'Reference1' => '001'
),
'OriginAddress' => array(
'City' => 'Amman',
'CountryCode' => 'JO'
),
'DestinationAddress' => array(
'City' => 'Dubai',
'CountryCode' => 'AE'
),
'ShipmentDetails' => array(
'PaymentType' => 'P',
'ProductGroup' => 'EXP',
'ProductType' => 'PPX',
'ActualWeight' => array('Value' => 5, …
Run Code Online (Sandbox Code Playgroud) 我在 WordPress 安装中对 WooCommerce 进行了自定义。
我有类似的东西:
/**
* Disable free shipping for select products
*
* @param bool $is_available
*/
function my_free_shipping( $is_available ) {
global $woocommerce;
// set the product ids that are ineligible
$ineligible = array( '14009', '14031' );
// get cart contents
$cart_items = $woocommerce->cart->get_cart();
// loop through the items looking for one in the ineligible array
foreach ( $cart_items as $key => $item ) {
if( in_array( $item['product_id'], $ineligible ) ) {
return false;
}
} …
Run Code Online (Sandbox Code Playgroud) 我有添加的自定义运输方法来计算运输,并使用以下代码
public function calculate_shipping( $package ) {
$postcode_data = $package['destination']['postcode'];
if(!empty($postcode_data)){
$weight = 0;
$zone_data = checkzone($postcode_data);
if(isset($package['destination']['postcode'])){
if(!empty($zone_data)){
$weight = WC()->cart->cart_contents_weight; // get cart total weight
if($weight <= 100){
$weight_range = ceil($weight / 10 );
}
elseif(($weight > 100 ) && ($weight < 150) ){
$weight_range = 11 ;
}
if($weight >= 150)
{
$weight_range = 12 ;
}
$pricing = getpricing($zone_data , $weight_range);
if($pricing > 0){
$rate = array(
'id' => $this->id,
'label' => 'Delivery',
'cost' => $pricing, …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Wordpress 上制作一个自定义页面,该页面以一种形式显示 2 种订阅类型,每种类型有 3 种变体(每月、6 个月、12 个月)。每个变体都有一个单选按钮,当用户单击单选按钮时,我有一个实时更新的总价格。这部分正在工作。
但是现在,我想添加 3 个其他单选按钮来选择发货方式。(当用户选择一个时,它也会实时更新总价)。
我一直在寻找如何获得产品的运费很长时间,但没有任何效果。
有谁知道 :) ?
php wordpress shipping woocommerce woocommerce-subscriptions
基本上我正在尝试使用具有运输类别"Roller"(ID )的购物车物品时flat_rate:7
禁用统一费率方法ID 92
.
这是我试过的代码:
add_filter('woocommerce_package_rates', 'wf_hide_shipping_method_based_on_shipping_class', 10, 2);
function wf_hide_shipping_method_based_on_shipping_class($available_shipping_methods, $package)
{
$hide_when_shipping_class_exist = array(
92 => array(
'flat_rate:7'
)
);
$shipping_class_in_cart = array();
foreach(WC()->cart->cart_contents as $key => $values) {
$shipping_class_in_cart[] = $values['data']->get_shipping_class_id();
}
foreach($hide_when_shipping_class_exist as $class_id => $methods) {
if(in_array($class_id, $shipping_class_in_cart)){
foreach($methods as & $current_method) {
unset($available_shipping_methods[$current_method]);
}
}
}
return $available_shipping_methods;
}
Run Code Online (Sandbox Code Playgroud)
发货类ID 92
是发货类,我想隐藏flat_rate:7
它.
我的网站是这样的:http://www.minimoto.me/ WordPress:4.8.4 WooCommerce:3.1.1
任何帮助将不胜感激.
I've been unable to crack this nut, but can't help feel that I'm missing something simple.
I'm developing a WooCommerce plugin that should provide a list of shipping classes on its admin settings page. The following code as suggested in another question's answer indicated that the following should work:
$shipping = new \WC_Shipping();
$shipping_classes = $shipping->get_shipping_classes();
var_dump($shipping_classes);
die();
Run Code Online (Sandbox Code Playgroud)
Unfortunately the output is an empty array.
I am using Wordpress 4.9.5 and WooCommerce 3.3.5. Thanks for any help!
UPDATE I have …
我有一个使用 WooCommerce 插件的 WordPress 网站。如果买家选择本地取货作为运输方式,我想为他们提供购物车总额 5% 的折扣。
我已经尝试过- 5 * [qty]但它似乎不起作用。
我也试过 -0.95 * [cost] 没有运气