Download the PHP package mysutka/product_feed_generator without Composer

On this page you can find all versions of the php package mysutka/product_feed_generator. 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 product_feed_generator

Product Feed Generator

This package provides library which helps create XML and CSV feeds for various price comparison services, e.g. Google Shopping, Heureka, etc. The library is intended to be extensible. A developer can create own generator for other price comparison services and he can also create own reader if he for example needs to alter selection of objects or work with different objects.

First you can see examples in src/robots/product_feed_generator_robot.php

Generators available for these price comparators

Base classes

Two basic classes are used which can be extended Atk14EshopReader selects, reads objects (usually products) and converts them to array FeedGenerator works with arrays returned by Atk14EshopReader. It should not be used directly. New class should be created which inherits FeedGenerator

Atk14EshopReader options

FeedGenerator options

Examples

Usually only the FeedGenerator class can be used:

This will output xml element DELIVERY_DATE containing text '25'. It will override original value if it should be generated by the generator.

Output

When needed elements that are normally in output can be removed. In this example generator by default outputs element EAN in each item. By specifying null for EAN in fixed_values option, the element will disappear from output.

Creating feed with prices in another currency, EUR for example

Custom Reader

Most common example is a reader which generates a feed for a limited set of products. In this case we create a new class as a descendant of ProductFeedGenerator\Reader\Atk14EshopReader which consists of a single method getObjectIds(). This LimitedEshopReader provides ids of products created during the last month.

If you need to filter out some products by a specific rule you can do it by itemToArray() method. See example

Custom Generator

Sometimes happenes that we need to send the comparison service a value that is a bit altered while the generator provides it as it is stored in the database. So let's create our custom Generator. Let's say our standard GoogleShoppingGenerator does not provide "g:availability" attribute (which in actually does) but there is attribute STOCKCOUNT provided by the main Atk14EshopReader class. So we create new Generator class which adds the STOCKCOUNT attribute to the values from the Reader class and then adds the "g:availability" attribute to the output.

The method getAttributesMap() is called in the parent Generator class. Here, we override it and add the g:availability attribute by using the general STOCKCOUNT attribute provided by the Reader class which is simply a number of products in our warehouse. Then we add the afterFilter() method which is also called by the parent class FeedGenerator. It is used to transform the values which would be normally sent to final output. In our method we modify the g:availability attribute to our needs, which means we send a text "in stock" or "out of stock" to the output instead of exact number.


All versions of product_feed_generator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
atk14/drink-markdown Version ~0.3
atk14/files Version ^1.0
atk14/string4 Version 0.* >=0.1.1
atk14/xmole Version ^1.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 mysutka/product_feed_generator contains the following files

Loading the files please wait ....