Giter Club home page Giter Club logo

google-shopping-feed's Introduction

Luke Snowden

Work?

I am currently employed in a full time position as a software engineer for Pearson UK, building software to allow students around the world sit exams online.

Personal?

I spend most of my spare time working on my side project vQuiz.

codeSTACKr's Github Stats

google-shopping-feed's People

Contributors

alexkvak avatar annuh avatar chrisgeonet avatar dmaksimov avatar east2dd avatar endelwar avatar fredyy90 avatar it-can avatar johanlerche avatar lukesnowden avatar mikeburke-adz avatar mrhn avatar neeo avatar nexxome avatar philipdbrown avatar pmhou avatar rasim avatar svanthuijl avatar timlenton avatar topbor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

google-shopping-feed's Issues

Variants should support unique MPN

According to the Google documentation, it says "Typically, each variant of a product (different colors or sizes) has its own MPN, so make sure to submit the correct value."

The function variant() in this library calls getGroupIdentifier() which requires an MPN (or GTIN) already be set before it can create the variant, meaning it is using the same one for all variants.

How can this be fixed?

Double encoding of image_link

When a variant is created, the already processed image_link node is encoded a 2nd time with safeCharEncodeURL() which produces a double encoded string. Namely ' ' (space) becomes %20 which then becomes %2520.

To fix this, I've used urldecode() on the image link string before it is ran through safeCharEncodeURL()

// src/LukeSnowden/GoogleShoppingFeed/Item.php:177
$imageLink = $this->safeCharEncodeURL(urldecode($imageLink);

Fix applied to #20

Promotion ID

I don't see the option to add the promotion_id:

lukesnowden/google-shopping-feed/src/LukeSnowden/Item.php

public function promotion_id($promotion_id)
{
$node = new Node('promotion_id');
$this->nodes['promotion_id'] = $node->value($promotion_id)->addCdata();
}

Problem when running over CLI

When calling Feed->asRss() when running over the CLI (an Artisan command) I get the error "ErrorException: ob_end_clean(): failed to delete buffer. No buffer to delete in ...\vendor\lukesnowden\google-shopping-feed\src\LukeSnowden\GoogleShoppingFeed\Feed.php:262"

The code runs fine when the same command is run through the browser.

Variant ID

I believe each variant should have a unique id, the example code doesn't suggest assigning a new id each each variant. I'm aware there is a item_group_id, but I believe that that the id should also be unique. It overrides the previous entry with that id if not I think.

Am I missing something or should $variant->id() be used for each variant?

Item title and link are not namespaced

The output has the item title tag as <title> and not <g:title>, and the same with link.
Because of this, the feed is flagged as having errors.
I've tested adding _namespace($this->namespace) to the title and link and it works.

add 2 more functions

public function multipack($multipack)
{
	$node = new Node('multipack');
	$this->nodes['multipack'] = $node->value($multipack)->_namespace($this->namespace);
}

public function unitPricingMeasure($unitPricingMeasure)
{
	$node = new Node('unit_​pricing_​measure');
	$this->nodes['unit_​pricing_​measure'] = $node->value($unitPricingMeasure)->_namespace($this->namespace);
}

Price Node does not include ISO 4217 Country Currency

Currently the price node has a float value of:

<g:price>15.00</g:price>

However in the current specification; it requires a second value adjacent to the numeric value of the originating countries currency.

Syntax

For E.g.

<g:price>15.00 USD</g:price>

The specification hasn't got a timestamp of when this was included.

Google Price Specification link

Add a constant list of all the supported possible Currencies? Default to USD if not present?

PHP ^7.0

Anyone know why namespacing is collapsing running PHP7?

identifier_​exists

Hello, I am trying to insert a product without identified GTIN and mpn, according to documentation shall be inserted the parameter:

If your product doesn't have both a GTIN and MPN:
Set identifier_​exists to no (FALSE)

How fix this? Thanks

Add custom attributes

It would be nice if we could add custom attributes, for example to include some specific product details.

This data cannot be used by Google directly, but it could be used by other services that support Shopping Feeds.

Do you like this feature?
I could create a PR for this if you'd like.

Namespace issue

I'm having different behaviour using your package on my production environment using php 7.0.15 than on my development environment using php 7.0.8.

In my production environment the namespace tags do not seem to be formed correctly - "<g:id/>1" and "<g:price/>12.50".

In my development environment they are created correctly - "<g:id>1</g:id>" and "<g:price>12.50</g:price>".

I noted in issue 10 #10 you have had namespace issues reported in php ^ 7.0. Does this issue match those previously reported? If so did you manage to isolate the cause?

Thanks in advance.

I want to create multiple feeds in one batch

The problem I face is that I need a new instance of the Feed class in order to create multiple feeds in one batch, the Item class is accessing the Feed object through the static singleton implementation, which in my eyes is a design flaw since I only ever can generate one feed in the same batch. Hence I need to be able to instantiate the feed outside a static context to allow for multiple feeds in the same batch.

Please accept my PR #30 it should not break anything and still let you use the static wrapper in the same way :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.