Giter Club home page Giter Club logo

silverstripe-swipestripe's People

Contributors

3dgoo avatar adamgiacomelli avatar bummzack avatar eimanavicius avatar erindru avatar frankmullenger avatar icecaster avatar jamesbolitho avatar jason-zz avatar limewub avatar mediabeastnz avatar nyeholt avatar shrikefin avatar stevie-mayhew avatar zauberfisch 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

Watchers

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

silverstripe-swipestripe's Issues

Too generic CSS Selectors

This is a rather annoying issue.

On CartForm.ss
CartQuantityField.ss and many more

you are using classes "left" and "right" to align text within table cells.

Some css frameworks (foundation in this case) use these classes to float elements, causing these elements to float all over the place.

Causing me having to overwrite almost every template file, just for the sake of renaming classes.

Suggestion:

rewrite all templates and css.
Only use prefixed classes as selectors:
sws_align-right

Still use ids on common elements in the markup, however do not use them in the css.

"Undefined offset: 0" in SQLQuery.php when opening a product

When creating a new product / querying for them

Notice: "Undefined offset: 0" at line 382 of /var/www/chillstore/httpdocs/sapphire/core/model/SQLQuery.php

this happens using SS 2.4.6 and the latest HEAD of swipestripe.

will try to fix and update here

Composer installation & emogrifier

Hello,

composer installation of 2.1.x@dev is installing tag 2.1.0 and never 2.1 branch.

composer installation of 2.1.x-dev is installing 2.1 branch, but dependancy "pelago/emogrifier": "0.1.1" requires php 5.4 which is above silverstripe's php 5.3.3 requirement :(

Can you downgrade emogrifier to 0.1? This version is php 5.3 safe...

Alternatively, can this package be optional and only shown as suggested?

Thanks

ENHANCEMENT: Turn Customer into a DataExtension

At the moment, Customer doesn't play nicely with existing systems.

If something already extends Member, whether its the user code or another module this will cause a conflict.

It also causes issues when adding the module to an existing system (as i'm finding out) where database records are already present for Members.

Is there a reason for it being a subclass?

Remove Legacy Code

There are a couple of legacy code snippets in the core, which we should remove.

examples:

  • LicenseKey db field
  • some left over of Stock management

Thousands of SQL queries to generate Product pages for products with 100+ variations

We've been having major performance issues with a Silverstripe project. As products have been loaded with multiple variations performance time has dropped substantially.

The following is for the Product page.

Using ?showqueries=1 on a product with 10 x 5 x 5 = 250 variations returned over 5,000 SQL queries.

Reducing the product to 10 x 5 = 50 variations reduced the query number to around 750.

Increasing the product to 10 x 5 x 5 x 5 = 1250 variations increased the query number to over 30,000.

Here is the output for 10 x 5 x 5: https://drive.google.com/file/d/0B_doMj_pm-5zMGFDLUNVYlc2M2c/edit?usp=sharing

Variations

I'm trying to set up a product which uses 4 different attributes in it's variations. I see that attributes are populated based on previous attribute sets (selects, data-map).

Trying to figure out how to display all possible options in all dropdowns based on everything that is enabled as a variation. What I'm getting is that the 3rd/4th dropdown is populated with all the options possible from added variations without looking back to option1/2 (to see if that variation is enabled at all). The pricehandling does only update if you make a valid selection, but as soon as you make a non-valid selection you can't add it to your cart.

Hmm, how to illustrate this...
For example:

attr1A - attr2A - attr3A
attr1A - attr2A - attr3B

attr1A - attr2B - attr3A
attr1A - attr2B - attr3B

attr1B - attr2A - attr3A

attr1B - attr2B - attr3A

If I select attr1B I should not be able to select attr3B. It is not added as a variation. But based on attr2A and attr2B i will still get 3B as an option (but I would not be able to add the product).

Any thoughts how this could be fixed?

Extending status of orders.

I wish to add an extra status to all orders: 'Returned'. It appears that I cannot use a dataextension to accomplish this. For the moment I have changed this in Order.php although this is not a great solution for the long term.
Is there another way this could be accomplished, or alternatively might it be possible to add a feature of site-defined status options?

Checkout / login for existing members

Hi,
I have implemented SwipeStripe in an already existing application which have members which can login. Now I want to give them the possibility to order products with their existing account. But this accounts doesn't have the member class Customer, so when they are on the checkout page they are asked to login or create an account while they are already logged in with their member account. Is there a solution/workaround for this wihthout changing the core of SwipeStripe?

Replace hardcoded strings with _t()

I have seen some places where strings are hard coded into code or template.
To keep the system translatable we should make sure all strings use _t() or <%t ... %>.

The reference between product, item, cart and order

Hi all,

I'm extending this awesome module so my client can add taxes to products. I can't use the tax module since that supports only one tax rate per country. In Holland we have different taxrates for different product groups.

Please tell me if the code could be better written or something like that.
I've extend the product class like this:

class Product_Extend extends DataExtension {
private static $db = array(
"Taxrate" => "INT(21)",
"BTW" => "Decimal(19,8)"
);

public function updateCMSFields(FieldList $fields) {
    $fields->addFieldToTab("Root.Main", new DropDownField("Taxrate", "BTW", array('21' => "21%",'6' => "6%")));
    return $fields;
}

public function calculateBTW() {
    $btw = $this->owner->BTW;
    $productPrice = $this->owner->Price;
    $tax = $this->owner->Taxrate;
    $btw = $productPrice * ($tax / 100);
    DB::query('UPDATE Product SET BTW = '. $btw . ' WHERE ID = '. $this->owner->ID . '');
}

}

This gives the user the option to chose a taxrate per product. The default is 21%. After that it calculates the tax and stores it in the database. This all works fine...

however i'm kinda stuck right now. correct me if i'm wrong, but the item class inherits the product values for usage in the cart. How can i pass those BTW and taxrate values to the item table? After that it shouldn't be much of a hassle to get them in the final order.

Thanks in advance

Make handling of state changes consitent and add hooks

There are several occaisons where states within SwipeStripe can change. By State I for example mean the Status of an Order, the Status of a Payment (I know, not strictly a problem of SwipeStripe), and so on.
For the payment, there already is a hook (onBeforePayment & onAfterPayment), but we should make the system more extendable by adding futher hooks, like for example:

  • onBeforeStatusChange / onAfterStatusChange
  • onBeforeCancel / onAfterCancel
  • perhaps also a hook that gets called after an Update has been added to the order (use case: I as developer of a site could implement that emails get sent out after an update has been added)

Also, the handling of the states should be made consistent to keep the system easy and maintainable, and also to even make the hooks possible.

I already have some ideas on how to refactor some parts, but can't put it into words right now.

Add product to shopping cart and AJAX feature.

Hi Frank!

When you add a product in the web page (click button), the web page refresh completely or this is done by AJAX?
If the answer is no. Are you going to include this feature in swipestripe?
When?

Thanks,
Regards,
Jose A.

filter orders by items

Was trying to get it so that CMS users could filter items in the model admin by items(for example t-shirt, hat or whatever.

Was trying the following code in order.php:

public static $searchable_fields = array(
  'ID' => array(
        'field' => 'TextField',
        'filter' => 'PartialMatchFilter',
        'title' => 'Order Number'
    ),
    'Member.Surname' => array(
        'title' => 'Customer Surname',
        'filter' => 'PartialMatchFilter'
    ),
    'Member.Email' => array(
        'title' => 'Customer Email',
        'filter' => 'PartialMatchFilter'
    ),
    'HasPayment' => array(
        'filter' => 'ShopSearchFilter_Payment',
    ),
    'Status' => array(
      'title' => 'Status',
        'filter' => 'ShopSearchFilter_OptionSet',
    ),
  //attempting to get items searchable in shop admin
  //    'Items' => array(
  //        'title' => 'Items',
  //        'field' => 'TextField',
        // 'filter' => 'PartialMatchFilter',
  //    )

);

But getting caught up and getting errors when I put in that code.

I might be missing somehting - or is there a better way to do it? So that some one could go and find orders with a certian product?

Why was stock level removed?

I've been trying to figure out how to enable stock level functionality, and by searching through the code I saw several comments relating to stock level. However it appears to have been removed, see frankmullenger@0bc5d0a for the relevant commit for Product, and frankmullenger@0bc5d0a for Variation.

Why was this done, as it seems like fairly core functionality for any shopping cart application. Is the intention to move this functionality to a separate module, and if so does this module exist?

Adding an update to an existing order creates an additional, empty order

I'm using SS 3.1.2 (silverstripe/silverstripe-framework@054b35d, silverstripe/silverstripe-cms@e2fa3b7) and the lastest Swipestripe commit (5edaa5d).

For completeness:

are also installed.

The issue I am raising is as follows: placing and paying for an order results in an entry like

screen shot 2013-12-18 at 11 46 31

To mark the order as shipped, a status update is added

screen shot 2013-12-18 at 11 47 38

which in turn creates a new, but empty order

screen shot 2013-12-18 at 11 47 55

The new order is not linked to the previously created status update. This behaviour seems unintentional.

Attribute_optionField error

Hello

I have just found a error that on IE8 it returns an error on line 47 char 10 on file Attribue_OptionField.js.

What is happening is it returns a blank dropdown field for the second option field. The top one works fine. It is just the data on drop down 2 that isn't working.

dropdown_2_not_showing

Any help would be greatly appreciated

Thanks

Hadlee

Attribute_OptionField SortOrder issue on Chrome

I noticed that on Chrome, the SortOrder of Attributes within Variations isn't adhered to. I tracked this down to the way that Chrome handles ID's and the order of items in a JavaScript array - if there is a set of numbers as keys, it will put them in ascending order automatically.

Example screenshot of Chrome:
chrome
Despite having set the Student Membership to appear before the Associate Membership, it is automatically ordered by Chrome to appear after it because of the higher ID number.

In Firefox:
firefox
Here, it is acting as expected, without the reordering of the array.

Refactor Templates to be more modular

Currently, many of the SwipeStripe modules just overwrite existing templates, this works well until 2 modules try to overwrite the same file, and one of the modules will not be used.
It also means that the integrity of SwipeStripe + modules is harder to keep clean, because if we change something in a template, we have to change it in all modules that overwrite it as well.

I would like to have a more $Layout style approach, to have a base template, and have variables at places where modules can add their content.


An example:

the Addresses Module overwrites the whole AccountPage.ss template to add the Address information to the Account page.
It should be possible to add an Extension to AccountPage, with for example a hook called insertBeforeContent or insertBeforeOrders, which can return a string that will be injected in the template before the Orders or the Content. (just a starting point, I am sure we will come up with a nicer solution)

Password Field populating / validation

when the OrderForm is submitted and returns with a validation error, the Password Field is populated with the submitted password.

The problem is that the field consist out of 2 inputs that check that you have entered the correct password twice.
now lets assume you enter the following:

  1. somepass
  2. someotherpass

after submitting, it will display an error like "Passwords have to match", but populates the field with:

  1. somepass
  2. somepass

so I could just resubmit the form and now it would work.
this however is a big problem, because if I misspelled my first password and accidentally do that 2nd submit, my account would be created with a wrong password.

In my opinion the password field should either not be populated at all, or only if the passwords matched.

cannot set decimal value

Hi,

somehow it's impossible to set an decimal value as a product price. The strange thing is that i can set 15.00, but not 15.30. This gives an error that references to the framework/model/mysqldatabase file.

I see in the demo that this must be possible. Any idea how to fix this?

Thanks in advance.

Attributes with the same title create duplicate tabs

Title for an attribute is used to display as the label for the dropdown on the product page and also create a tab under 'Attributes' tag when editing a product in the CMS.

So, two attributes titled 'size' will cause issues with tabs in the CMS. Need to possibly add a label field to attributes and require title to be unique.

Exporting orders?

I was have look around to se how to get a CSV export of orders- and found that you've removed the 'gridFieldExportButton' in ShopAdmin.php line 142. Even tho its set to show 'before' on line 135.

Was there any reason for this to the functionally?

I have changed line138-142 to get basic export going:
$fieldConfig = GridFieldConfig_RecordEditor::create($this->stat('page_length'))
->addComponent($exportButton)
->removeComponentsByType('GridFieldFilterHeader');
//->removeComponentsByType('GridFieldToolbarHeader')
// ->removeComponentsByType('GridFieldExportButton');

OrderForm.php - process() misses an edge/rare case

Line 273

This will cause an uncaught ValidationException as it does not check the Member table, only the members linked to via the Customer table.

If I create an account (say the primary admin account when I install SS) with an email [email protected] and then I try to purchase an item using the [email protected] email address on the checkout page without being logged in - the system will try to write that member and blow up as a result. [email protected] won't be a customer, but will be a member, which SS will find out about when it tries to write a new member on top of it.

Make the JavaScript more extendable

Some parts of the Javascript are pretty much unextendable and unchangeable.
I am not sure if I am just to stupid to use entwine namespaces, but I have been trying for ages to overwrite the OrderForm submit handler.

the submit handler is bound using this.on('submit', function(e){}) in onmatch of $('.order-form')
We should refactor that to use the entwine onsubmit syntax.

Merge docs into this repository

As far as I can tell, it is convention for SilverStripe modules to have a docs folder in the repository.
Until now, SwipeStripe had the docs folder in a separated repository (I guess to make the auto publish on http://swipestripe.com/dev/docs/swipestripe/en easier)

I would like to suggest merging the docs repository into this repository. This will yield several benefits:

  • developers that use SwipeStripe get the docs and code in one package
  • it is easier to maintain docs if they are part of the repo (Its hard enough already to motivate myself to write docs, I can't be bothered to do it in a separated repository :P)
  • it aligns with how its done in SilverStripe and other modules (eg: framework, gridfieldextensions by ajshort)

the only downside that I can see is that auto deployment of the docs is a bit more work, but shouldn't really be a problem.

Permissions for viewing Orders

Hi Frank

Why was the way permissions are checked for viewing orders changed recently (f8e6d74)? For my instance I need CMS members that can only view and edit orders but have no further backend access. It seems as if due to the referenced modification, this is no longer possible:

public function canView($member = null) {

    if ($member == null && !$member = Member::currentUser()) return false;

    $administratorPerm = Permission::check('ADMIN') && Permission::check('VIEW_ORDER', 'any', $member);
    $customerPerm = Permission::check('VIEW_ORDER', 'any', $member) && $member->ID == $this->MemberID;

    return $administratorPerm || $customerPerm;
}

Now the user who wants to view orders in the backend has to have both 'ADMIN' and 'VIEW_ORDER' permissions. Am I mistaken? Isn't my use case one I should be able to instantiate? Am I able to do so without extending your Order class?

Best,
Nicolas

No attributes seem to be shown.

I've got 2 fresh installations of SwipeStripe on Silverstripe 3.1.0-rc1 and 3.1.1 and neither seem to show attributes on product pages.

I've tested the data entered on the demo site within my installations and neither seem to be working. They're also on PHP 5.4 and 5.5

Show price including tax rates in front-end.

Hi,
I would like to show the price of a product including tax. The tax is now shown during checkout.

In Holland company's don't have to pay the tax. So then it wouldn't be a problem. But since my shop is for consumers it would be nice to see the total price per product before the checkout.

Do you have any idea's?

No guest checkout

I know this has been discussed previously as something that needs to be worked on separate to the Customer/Memebr issue.
I thought it best to bring up an issue here so it doesn't get forgotten.

I've started using Swipestripe for online shop solutions for both my private clients and through Plastyk Studios (the web studio I work for). We're all quite impressed by the out of the box function Swipestripe gives you, but we think that it's very important to have some sort of guest checkout.

I'm happy to help out with the work to get this going if you need an extra pair of hands ;)

Directly redirect to the cart instead of back to the product page.

Hi,

I'm building a product where it's possible to buy just one product. Because of the fact we are only selling one product it would be nice to automatically redirect to the cart when you add the product to the cart. Now its redirecting back to the product page.

There is this variable $redirectURL in ProductForm.php. How can i change it so it redirects to the cart?

Thanks in advance

Unit tests: fix existing and add more

always good to have more tests, right?

Besides, it seems to be that a hand full of the tests are not passing.
@frankmullenger are the tests passing for you?
If you can confirm that all SwipeStripe related tests pass for you, I will look into my setup, otherwise I will update this issue with further details.

Display variation price in select option

I was wondering if you could point me in the right direction with getting the price displaying in the option on the product page?

I see they are all in the data-map so I could potentially do it with javascript but I was hoping it would be possible to add in the form itself.

Option to disable jQuery

Is there an option to disable jQuery loading from Swipestripe? That would be a great option in YML, as your theme might already use it and you want to load it only once.

Namespace Classes

I noticed many classes in SwipeStripe are very generic.

  • Item
  • ItemOption
  • Modification
  • Order
  • GridFieldConfig_Basic
  • GridFieldDetailForm_HasManyItemRequest
  • OptionField
  • Price
  • PriceField
  • AccountPage
  • Customer
  • NotificationEmail
  • Payment_Extension
  • Attribute
  • Option
  • Variation

Those names are likely to be used in another module as well. Some more than others, but if just one is the same in another module, that makes them instantly incompatible.

It is important that we somehow namespace those items.
One way of doing it would be to rename them to eg SwipeStripePrice, but the cleaner way of course would be to use actual namespaces, but unfortunately I don't know what the state on those is. Perhaps @simonwelsh can bring us up to speed on the status of namespace support in SilverStripe (pretty please)?

Different tax/vat rates per product

What would be the best way of implementing different tax/vat rates per product or product categories? In Finland we have multiple tax categories based on product type.

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.