ckreidl/woo-dimension-check 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ckreidl/woo-dimension-check

Composer 安装命令:

composer require ckreidl/woo-dimension-check

包简介

Checks WooCommerce product database via Woo's REST API to identify items that have no weight or dimensions.

README 文档

README

woo-dimension-check is a library that helps to identify WooCommerce products with no weight, length, width, or height.

Installation

composer require ckreidl/woo-dimension-check

Usage

use ckreidl\WooDimensionCheck;

$url = 'https://your_store_url.com';
$key = 'consumer_key';
$secret = 'consumer_secret';

$missing = new WooDimensionCheck\DimChecker($url, $key, $secret);

Example

$missing = new WooDimensionCheck\DimChecker($url, $key, $secret);

print "There are " . count($missing->weight()) . " items missing weights. They are: \n";
array_walk($missing->weight(), function($prod) { print "{$prod->id} "; }); print "\n";

Background

I ran into some issues where the shipping calculators we were using wouldn't play nicely if items didn't have weights and/or measures entered. For example:

  1. Customer adds widget A to their cart, which doesn't have dimensions or a weight listed
  2. Customer proceeds to checkout
  3. Shipping calculator, not knowing the size or weight of widget A, declines to show them shipping options

Meanwhile, another customer adds the same widget A as well as widget B, which does have weight & dimensions

  1. Customer adds widget A to their cart, with no weight or dims
  2. Customer adds widget B, with weight & dims
  3. Shipping calculator defaults to 0 for widget A, solely calculating shipping based off weight and dims of widget B

We can go back and forth all day about what the default behavior should be when an item without this information is encountered. It's my opinion that the database should have that information, so I wrote this little tool to identify items that don't have that data entered.

License

GPL 3.0

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-02-17