swipestripe / silverstripe-swipestripe Goto Github PK
View Code? Open in Web Editor NEWEcommerce module for SilverStripe
Home Page: http://swipestripe.com
Ecommerce module for SilverStripe
Home Page: http://swipestripe.com
When the attribute option dropdown fields are updated they should select the previously selected option if it is still available.
@TamaEaston this should cover the issue from your email?
Would I be right in assuming that SwipeStripe doesn't support the merchant hosted payment flow?
I've tried it with the https://github.com/frankmullenger/silverstripe-gsoc-payment-test (merchant hosted) and it just seems to redirect straight to the completed order page, without the credit card input/check stage.
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.
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
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
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?
Hey Frank,
just realised the cart and checkout page arent being created as expected.
I am unable to create them manually, will provide more details soon.
Cheers
PS.
the site is coming together nicely:
http://chillshop.chillstudio.co.nz/
There are a couple of legacy code snippets in the core, which we should remove.
examples:
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
Apply a class selector to wrap all generic styles included by SwipeStripe - like the twitter bootstrap form and table styles.
Hi Frank!
From what I see now SwipeStripe is open source.
Does the rest of modules are open source?
Currency, Category, Coupon , Addresses , Tax, Shipping, Downloadable , ...
Thanks,
Regards,
Jose A.
Suggest delivering working configs for paypal & co
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?
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?
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?
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 ... %>
.
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
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
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.
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.
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?
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?
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
To mark the order as shipped, a status update is added
which in turn creates a new, but empty order
The new order is not linked to the previously created status update. This behaviour seems unintentional.
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.
Any help would be greatly appreciated
Hadlee
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:
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:
Here, it is acting as expected, without the reordering of the array.
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)
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:
after submitting, it will display an error like "Passwords have to match", but populates the field with:
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.
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.
When the quantity of an item is changed in the shopping cart and press the tab key will not change the total price.
Regards,
Jose A.
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.
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');
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.
Hook for after Products are purchased.
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.
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:
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.
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
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
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?
Currencies such as Japanese Yen have no decimal place, currently the lower bound on decimal places is set to 2 (
).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 ;)
This needs to be replaced with code which works in SS3.1
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
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.
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.
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.
I've come across a bug and have replicated it on the SwipeStripe demo site: http://ss3.swipestripe.com/clothing/hats/cowboy-hat/
When three options are added to a product the middle option drop down has attributes appearing multiple times.
In the linked example the following variations have been set:
Inline images 1
This causes the middle drop down to display the following:
Inline images 2
I noticed many classes in SwipeStripe are very generic.
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)?
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.
composer.json still contains links to frankmullenger/silverstripe-swipestripe
https://packagist.org/packages/swipestripe/swipestripe also still references to frankmullenger/silverstripe-swipestripe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.