2017 © Pedro Peláez
 

library export

Export products for Heureka and Zbozi

image

trejjam/export

Export products for Heureka and Zbozi

  • Thursday, August 27, 2015
  • by trejjam
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Export

Library for export products to - Heureka - Zbozi, (*1)

in Nette, (*2)

Installation

The best way to install Trejjam/Export is using Composer:, (*3)

$ composer require trejjam/export

Configuration

.neon, (*4)

extensions:
    export: Trejjam\Export\DI\ExportExtension

export:
    exportsDir: '%wwwDir%'
    exports   : 
        heureka: yes
        zbozi  : yes

Config

For run is used Kdyby/Console Read how to setup Kdyby/Console, (*5)

php index.php

After successful installation display:, (*6)

Available commands:
Cron:export     Export products

Usage

Products:, (*7)

services:
    - Products
use Nette,
    Trejjam;

class Products implements Trejjam\Export\IProducts {
    /**
     *  {@inheritdoc}
     */
    public function getItems(Trejjam\Export\StoreItems $storage, $shop, Symfony\Component\Console\Command\Command $command, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) {
        foreach ($this->getProducts() as $v) {
            if ($shop=='heureka') {
                $item = new Trejjam\Export\Heureka\Item;

                $item->id = $v->id;
                $item->name = $v->name;
                $item->longName = $v->description;
                $item->description = $v->description2;
                $item->url = $presenter->link('//:presenter:action', ['productId' => $v->id,]);
                $item->img;

                $imgAlternative = new Trejjam\Export\Heureka\AlternativeImg;
                $imgAlternative->img;
                $item->imgAlternative[] = $imgAlternative;

                $item->video;
                $item->price;
                $item->type;
                $item->cpc;
                $item->manufacturer;
                $item->category;
                $item->ean = $v->EAN;
                $item->isbn;
                $item->no = $v->code;

                $param = new Trejjam\Export\Heureka\Params;
                $param->name;
                $param->value;
                $item->params = [];

                $item->deliveryDate;

                $delivery = new Trejjam\Export\Heureka\Delivery;
                $delivery->name;
                $delivery->price;
                $delivery->priceCod;
                $item->delivery[] = $delivery;

                $item->groupId;
                $item->accessory;

                $storage->addItem($item);
            }
            else if ($shop=='zbozi') {
                $item = new Trejjam\Export\Zbozi\Item;

                $item->product;
                $item->name;
                $item->nameExt;
                $item->description;
                $item->url;
                $item->img;
                $item->price;
                $item->vat;
                $item->priceVat;
                $item->cpc;
                $item->cpcSearch;
                $item->dues;
                $item->deliveryDate;
                $item->shopDepots;
                $item->unfeatured;
                $item->type;
                $item->extraMessage;
                $item->manufacturer;
                $item->category;
                $item->no;

                $variant=new Trejjam\Export\Zbozi\Variant;
                $variant->nameExt; //rewrite Item::properties
                $item->variants[]=$variant;

                $storage->addItem($item);
            }
        }
    }
}
$ php index.php Cron:export -p

Execute config

$ php index.php Cron:export -e heureka -e zbozi

The Versions

27/08 2015

dev-master

9999999-dev

Export products for Heureka and Zbozi

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jan Trejbal

nette heureka zbozi

06/08 2015

v0.3

0.3.0.0

Export products for Heureka and Zbozi

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jan Trejbal

nette heureka zbozi