定制 sylapi/feed-compari 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sylapi/feed-compari

Composer 安装命令:

composer require sylapi/feed-compari

包简介

Compari merchant feeds

README 文档

README

Latest Stable Version Total Downloads License PHP Version

PHP library for generating Compari merchant feed XML files. This package provides an easy way to create product feeds compatible with Compari shopping platform.

Requirements

  • PHP 8.0 or higher
  • sylapi/feeds ^1.0.0

Installation

Install the package via Composer:

composer require sylapi/feed-compari

Usage

<?php

require_once 'vendor/autoload.php';

use Sylapi\Feeds\FeedGenerator;
use Sylapi\Feeds\Compari\Feed;
use Sylapi\Feeds\Parameters;
use Sylapi\Feeds\Models\Product;

// Create feed generator
$feedGenerator = new FeedGenerator();
$feedGenerator->setFeed(new Feed(
    Parameters::create([
        'title' => 'My Store Products',
        'description' => 'Product feed for Compari comparison shopping',
        'link' => 'https://mystore.example.com/',
    ])
));

// Create and add products
$product = new Product();
$product->setName('Example Product')
        ->setPrice(99.99)
        ->setCurrency('PLN')
        ->setAvailability('in stock')
        ->setDescription('Product description...')
        ->setUrl('https://mystore.example.com/product/123')
        ->setImageUrl('https://mystore.example.com/images/product123.jpg');

$feedGenerator->appendProduct($product);

// Add more products...
// $feedGenerator->appendProduct($anotherProduct);

// Generate and save the feed
$feedGenerator->save();
echo "Feed saved to: " . $feedGenerator->filePath();

Development

Available Commands

Command Description
composer tests Run PHPUnit tests
composer phpstan Run PHPStan static analysis
composer coverage Generate PHPUnit coverage report in text format
composer coverage-html Generate PHPUnit coverage report in HTML format (saved to ./coverage/ directory)

Running Tests

# Run all tests
composer tests

# Run tests with coverage
composer coverage

# Generate HTML coverage report
composer coverage-html

Static Analysis

# Run PHPStan analysis
composer phpstan

License

This package is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固