Download the PHP package thepublicgood/bidfeed without Composer

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

BidFeed

Build Status

Bid or Buy XML Feed Library

BidFeed is an XML generator for the Bid or Buy XML feed.

Installation

BidFeed should be installed through Composer:

Usage

You'll need to require the Composer autoloader if you're not using a framework that does so automatically.

Start by creating a new instance of TPG\BidFeed\Builder. The methods on the Builder.

The Builder class provides a products() method that returns a TPG\BidFeed\Collection instance. You can add new products to the feed by pushing new instances of TPG\BidFeed\Product.

Generating the XML

At any point, you can get a copy of the XML by calling the toXml() method on the Builder instance.

Calling the toXml() method does not alter the instance in any way, so you can continue to build up products even after generating an XML output.

The toXml() method will also call the verifyAttributes() method on each Product instance. If there is anything missing, a MissingRequiredAttribute exception will be thrown.

Adding Products

You build up a feed by adding products. The Product class provides a simple API for working with products.

A single product is represented by an instance of Product. the Builder::products() method always returns a Collection instance containing a set of Product instances.

Required Attributes

Some attributes are generally not required unless the product needs to appear in Google Ads posted by Bid or Buy, then these attributes MUST be supplied:

A number of attributes are required. All products must have a name, a product code, a category, price, quantity, and description. If any of these attributes are missing on a single product, a MissingRequiredAttribute exception will be thrown.

Setting a product code

A product MUST have a unique product code and it cannot change. Any duplicate product codes will be ignored an the product will not be imported. The product code has a maximum length of 100 characters.

Setting a product name

All products must be named. You can specify the product name using the name method. Product names cannot be longer than 100 characters:

Setting a description

The description of the product should include the details of the product. It cano be upto 8000 characters long and can include some limited HTML. The BidFeed library currently allows P and BR html elements.

Setting a category

A product category must be supplied with app products and preferably based on Google's taxonomy. See [https://support.google.com/merchants/answer/6324436](). It's recommended that the full category path be specified. The category method accepts an array of category names. So if the category should be Electroncis - Laptops - Apple you can do:

Setting Price

All products MUST have a price set. There are two prices that a product can have. The actual selling price, which is required, and a market price, which is optional. The market price is only for reference and not used as a selling price in any way.

You can set both prices by passing the selling price, and the market price at floats to the price() method, or set the market price separately using the marketPrice() method.

Available Quantity

Bid or Buy require that an available quantity be specified. You can specify the quantities using the availableQuantity() method. Any product with a quantity of 0 will not be imported.

Product Images

Images must included with all products. At least one image must be provided. You can provide more than one, but only the first image will be used as the product cover image. Images are displayed by Bid or Buy in the order they are provided.

You can provide a set of image URLs by passing an array to the images() method.

Images are stored as a Collection instance. You can get to the instance using the imageCollection() method.

Product Attributes

Products can have an optional set of custom attributes. It's common to add a Brand attribute here, but you can add any attributes needed. According to the Bid or Buy feed spec, attributes that do not match marketplace values are ignored, so you should only add attributes that are category specific.

Guarantees and Warranties

Products can have a gaurantee and/or a warranty set. You can set gaurantees using the guarantee method, and warranties can be set using the warranty method. The signature for both methods is identical:

BidFeed provides a set of constants for gaurantee and warranty types:

The second parameter allows you to specify more detail around the guarantee or warranty. The text MUST be provided if the first parameter is anything but `GUARANTEE_

Shipping Class


All versions of bidfeed with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-json Version *
ext-dom Version *
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 thepublicgood/bidfeed contains the following files

Loading the files please wait ....