Download the PHP package tmaic/tmaic-sku without Composer

On this page you can find all versions of the php package tmaic/tmaic-sku. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tmaic-sku

tmaic-sku

适用于Laravel的商品属性,SKU模块实现

名词介绍

安装

引入

发布迁移文件

运行迁移

如果需要发布配置文件,请运行以下命令:

使用

在商品模型中引入Tmaic\TmaicSku\Traits\HasSkuTrait


注意事项 如果报以下错误

SQLSTATE[42000]: Syntax error or access violation: 1463 Non-grouping field 'attrs_count' is used in HAVING clause (SQL: select skus., (select count() from attrs inner join attr_sku on attrs.id = attr_sku.attr_id where skus.id = attr_sku.sku_id) as attrs_count from skus where id in (select sku_id from attr_sku where sku_id in (select sku_id from attr_sku where attr_id in (79, 84))) having attrs_count = 2 limit 1)

需要在 config/database.php 下的配置:如下

'strict' => false,

将 strict 改为 false

选项新增

选项删除


获取商品属性值

新增商品属性值

同步商品属性值

移除某选项下的所有属性值

参数说明:

  1. $option 属性实例/属性ID/属性名称
  2. $value 属性值数组 每一项将会创建或同步属性值

创建(同步)SKU

如果属性值存在,则更新SKU,否则创建SKU
sku的属性组合是建立在产品基础属性值之上的,分配sku属性值组合前请添加产品属性值

syncSkuWithAttrs参数说明:

  1. $position 属性值组合数组,每项类型为:属性值实例/属性值ID
  2. $payload SKU数据,如金额,库存

获取SKU

删除SKU

通过属性值组合获取SKU

调整SKU的属性值组合


完整示例


All versions of tmaic-sku with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ~5.5||~7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tmaic/tmaic-sku contains the following files

Loading the files please wait ....