Giter Club home page Giter Club logo

ithemes-exchange-digital-variants's Introduction

Hi there ๐Ÿ‘‹

I'm Sam, just another nerd.

I really enjoy tinkering with software. You can see some discussion at my neglected blog: sambriggs.dev.

I get a real kick out of someone opening a PR on one of my projects, so don't be shy!

Sam's GitHub stats

Top Langs

ithemes-exchange-digital-variants's People

Contributors

briggysmalls avatar

Watchers

 avatar  avatar  avatar

ithemes-exchange-digital-variants's Issues

Handle updates better

At the moment if the digital variant needs changing (due to a plugin update) then it must be deleted then re-added.

This is no good if many products already exist, as deleting the variant removes it from all of them.

Either the variant should be updated or deleted/readded to all of the existing products when the version number changes.

Note: that this should not change the variant title or value titles back to the default

Make digital options configurable

With the introduction of a single variant shared by all products comes potential improvements.

A user can now rename and add/remove options to the variant and this will be reflected on all products.

However, the variants recognised as being digital are still fixed as those with a value matching the digital slug (hardcoded).

Addon settings should be introduced, allowing a user to pick which values are the digital ones.

Variant is not visible from frontend

The digital variants are currently not visible from the frontend. Furthermore when attempting to set a variant pricing, it is revealed that the variant values are missing from the select box.

commit: cbcaee2

Plugin breaks table rate shipping

When added to a website the plugins installation seems to have caused all shipping to be applied as the default 'International' instead of correctly identifying 'UK'.

Add CI

A CI server should be set up to run the linter and execute tests

Delete any orphaned digital variants

If a setting is missing a new digital variant is created.

This means that if the digital variant id is lost somehow, or the digital variant value is lost, posts can be left orphaned.

Some attempt to cleanup should be made when creating a new variant

Decide on better naming

The terminology employed up until this point is completely confusing.

Currently the following concepts are in use:

  • Feature that means products can take many flavours: variant
  • A product that has a distinct flavour: variant
  • A database object that describes a set of flavours: variant
  • A product that has either physical or digital flavours: digital variant
  • A product that is of the digital flavour (out of possible physical/digital): digital variant

This really needs sorting out as the terms are so overloaded it is hard to understand what the code is trying to do.

Improve 'is digital variant' test for product

A product is currently identified as being the digital variant of a product, based upon whether it has a value with a slug/post_name of 'digital'.

However, should multiple format variants be created, this slug becomes digital-x where x is an integer.

The test should be improved to be more robust

Write tests

In just a few commits, regressions were introduced that broke the plugin. Tests should be written to avoid this

Make Digital Variant custom product type

iThemes has a concept of Product Types, with the core plugin creating:

  • Simple Product
  • Physical Product
  • Digital Download

The Digital Variant product should be its own product type. This means that Physical products could be unaffected by the addition of this plugin (e.g. downloads not added to them) which may be desirable. Furthermore it simplifies the identification of products that have a variant indicating if they are Physical/Digital, as all that need be checked is the type. Perhaps a filter could be added that automates the addition of the variant too.

It seems very simple to add a product type, for example the Simple Product type is created with:

// Simple Product Types
'simple-product-type' => array(
	'name'        => __( 'Simple Products', 'it-l10n-ithemes-exchange' ),
	'description' => __( 'This is a basic product type for selling simple items.', 'it-l10n-ithemes-exchange' ),
	'author'      => 'iThemes',
	'author_url'  => 'http://ithemes.com',
	'file'        => dirname( __FILE__ ) . '/product-types/simple-products/init.php',
	'category'    => 'product-type',
	'tag'         => 'core',
	'labels'      => array(
		'singular_name' => __( 'Simple Product', 'it-l10n-ithemes-exchange' ),
	),
	'supports' => array(
		'sw-shortcode' => true
	)
),

where init.php is an empty file.

Call to undefined function

A misnamed function causes the plugin to break when attempting to checkout with a digital variant.
This should be fixed.

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.