Git Product home page Git Product logo

woocommerce / woocommerce Goto Github PK

View Code? Open in Web Editor NEW
9.1K 582.0 10.7K 699.26 MB

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.

Home Page: https://woocommerce.com

JavaScript 17.72% PHP 50.67% CSS 3.96% Shell 0.23% Gherkin 0.03% HTML 1.21% TypeScript 22.45% SCSS 3.50% Dockerfile 0.01% Batchfile 0.01% Mustache 0.10% EJS 0.04% Roff 0.01% MDX 0.02% Handlebars 0.04%
woocommerce wordpress php automattic ecommerce ecommerce-platform hacktoberfest reactjs

woocommerce's Introduction

WooCommerce Monorepo

WooCommerce

Welcome to the WooCommerce Monorepo on GitHub. Here you can find all of the plugins, packages, and tools used in the development of the core WooCommerce plugin as well as WooCommerce extensions. You can browse the source, look at open issues, contribute code, and keep tracking of ongoing development.

We recommend all developers to follow the WooCommerce development blog to stay up to date about everything happening in the project. You can also follow @DevelopWC on Twitter for the latest development updates.

Getting Started

To get up and running within the WooCommerce Monorepo, you will need to make sure that you have installed all of the prerequisites.

Prerequisites

  • NVM: While you can always install Node through other means, we recommend using NVM to ensure you're aligned with the version used by our development teams. Our repository contains an .nvmrc file which helps ensure you are using the correct version of Node.
  • PNPM: Our repository utilizes PNPM to manage project dependencies and run various scripts involved in building and testing projects.
  • PHP 7.4+: WooCommerce Core currently features a minimum PHP version of 7.4. It is also needed to run Composer and various project build scripts. See troubleshooting for troubleshooting problems installing PHP.
  • Composer: We use Composer to manage all of the dependencies for PHP packages and plugins.

Once you've installed all of the prerequisites, you can run the following commands to get everything working.

# Ensure that you're using the correct version of Node
nvm use
# Install the PHP and Composer dependencies for all of the plugins, packages, and tools
pnpm install
# Build all of the plugins, packages, and tools in the monorepo
pnpm build

At this point you are now ready to begin developing and testing. All of the build outputs are cached running pnpm build again will only build the plugins, packages, and tools that have changed since the last time you ran the command.

Check out our development guide if you would like a more comprehensive look at working in our repository.

Repository Structure

  • Plugins: Our repository contains plugins that relate to or otherwise aid in the development of WooCommerce.
    • WooCommerce Core: The core WooCommerce plugin is available in the plugins directory.
  • Packages: Contained within the packages directory are all of the PHP and JavaScript provided for the community. Some of these are internal dependencies and are marked with an internal- prefix.
  • Tools: We also have a growing number of tools within our repository. Many of these are intended to be utilities and scripts for use in the monorepo, but, this directory may also contain external tools.

Reporting Security Issues

To disclose a security issue to our team, please submit a report via HackerOne here.

Support

This repository is not suitable for support. Please don't use our issue tracker for support requests, but for core WooCommerce issues only. Support can take place through the appropriate channels:

NOTE: Unfortunately, we are unable to honor support requests in issues on this repository; as a result, any requests submitted in this manner will be closed.

Community

For peer to peer support, real-time announcements, and office hours, please join our slack community!

Contributing to WooCommerce

As an open source project, we rely on community contributions to continue to improve WooCommerce. To contribute, please follow the pre-requisites above and visit our Contributing to Woo doc for more links and contribution guidelines.

woocommerce's People

Contributors

aljullu avatar barryhughes avatar chihsuan avatar claudiosanches avatar claudiulodro avatar coenjacobs avatar gigitux avatar github-actions[bot] avatar jameskoster avatar jeffstieler avatar jonathansadowski avatar joshuatf avatar justinshreve avatar kloon avatar konamiman avatar louwie17 avatar mattsherman avatar mikejolley avatar moon0326 avatar obliviousharmony avatar opr avatar peterfabian avatar psealock avatar renovate-bot avatar renovate[bot] avatar rodelgc avatar rodrigoprimo avatar roykho avatar rrennick avatar vedanshujain 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

woocommerce's Issues

JS error

I'm getting the following error when editing/adding a project:

Uncaught TypeError: Object [object Object] has no method 'datepicker' (write-panels.min.js).

The error breaks all the js on the page. My browser is Google Chrome 14.0.835.186 on Windows 7.

Can't update catalogue image sizes

Using latest git as of time of report, any attempt to update the image size settings ( WooCommerce > Settings > Catalog > Image Options ) results in them just defaulting back to standard. It looks like they do temporarily get saved in the DB, but then get overwritten again somewhere.

Declined payments not clear to customer

Declined payments from the originating merchant are not clear to the customer.

Currently

Client pays via Credit Card and Credit Card is declined.

Gateway receives notification that the payment is declined, updates order notes for the owner

$order->update_status('pending', sprintf(__('response is "%s"', 'woothemes'), strtolower($paygate_response) ) );

Redirects user to the Thank You page and tells the user that the order has been processed successfully.

User need to go to the "My Account" section to see the payment has failed and re-attempt the payment, which is an extra step for users, and not common practice. Most eCommerce platforms will allow you to try the payment again on the declined page.

Suggestion

  1. Add additional status "declined" $order->update_status('declined', ...
  2. Redirect user to Thank You page with a message saying that their order was declined, instead of "processed successfully" and option to click a button to pay again or tell the user that their ordered must be attempted again via the "My Account" section.

Text attributes

What's the current difference between a select and text attribute? My shop would sell personalized products, meaning that they would enter a name and I assumed this would be done through text attributes.

However, text attributes still show a dropdown. Is this intentional or simply a feature that's not yet complete?

Multiple PHP Notices when on all front end pages

I get the following error on every single page that WooCommerce creates other than the "Shop" page. The main notice is:

Notice: Undefined property: WP_Query::$post in /Users/account/Sites/hats.us/wp-includes/query.php on line 2949

The stack traces the error down to something going on in:

WP_Query->is_page( $page = '4' ) ../woocommerce_query.class.php:33

I can't quite make out what is going on in that file at this point, but thought you'd want the information.

This error initially occurred when I created multiple tax rates. I removed the second tax rate and it went away; however, I since repeated my steps and cannot get the notice to go away.

This is of course occurring with WP_DEBUG set to true.

Saving image sizes

WooCommerce>Settings>Catalog>Image Options - it won't let me change the size of the image? I make the change, hit save and it reverts back to the original sizes.

Add to cart on shop page

When I click on "Add to cart" on any product on the Shop page the item are added to my cart but I don't get the message "Product successfully added to your cart.".

View Order - Variation Display Issues

Variations seem to work great on the front end all the way up through checkout. The options selected display properly on the cart and final checkout page.

One problem that I'm not sure if it can even be fixed, is that the Variation options aren't passed to paypal. SO when I look at paypal (or in the invoice paypal sends me), it just has the product name, not the actual variations I picked.

The other problem is when I as a customer "view my order" on the front end. It isn't showing the right selections. As per my previous example, I have 2 variations.. On the "view my order" page, it shows the first one correct "Bag Size: 12oz", but then for the second it just says "Ground Type: " without displaying the actual value.

Also on the admin Orders area for this order, while it appears the "meta" fields were populated properly, the same problem as above appears in the first Name column, where it does not output the second variation, for example: "Test Coffee" Bag-size: 16oz, Grind-type: "

Loading custom payment gateways

Hey guys,

Not sure if I am doing something stupid, or the wrong way around. I am working on a custom payment gateway, and wanted to test loading etc.

To test, I duplicated the bank transfer gateway, and renamed the class and all relative functions, and included the class file in functions.php but the payment gateway is not loading. I have tried to use the hook as it is included in the class file as well as putting the code in functions.php

// Include Additional Payment Gateway (EFT)
include('bodythrills/code/bt-banktransfer.woocommerce.php'); // @class: woocommerce_eft
function add_eft_gateway( $methods ) {
    $methods[] = 'woocommerce_eft'; 
    return $methods;
}
add_filter('woocommerce_payment_gateways', 'add_eft_gateway' );

Undefined index errors in the general settings

On the general settings page, I get two undefined notice errors. This occurred right after a fresh install of the plugin.

The errors occur on line 144 of admin/admin-settings-forms.php. I get two undefined notice errors for "css" and "std". My assumption is that these values are created after the first time you save values to form these form fields and the errors go away, but just wanted to point out that your $value array does not have those indices and some check should be put in place.

Variable Product Issues

Found a couple of issues with Variable Products.

Product Scenario:
Product = Coffee, Attribute 1 - Bag Size, Options: 12oz | 16oz (flagged as variation), Attribute 2 - Ground Type, Options: Ground | Wholebean
Price is 12.99 for any 12oz bag (regardless of Ground Type), Price is 14.99 for 16oz bag (regardless of ground type)

Issue 1: When you save, it does not remember your options you selected for the variations, and defaults back to the generic drop-down items of "any bag, any ground type".

Issue 2: I should be able to only have to create 2 variations.... Variation 1: ANY Ground type - 12oz Bag - $12.99..... Variation 2: ANY Ground Type - 16oz Bag - $14.99 ..... The problem is this does not work. It only allows me to select the bag size when I view the product on the website. The Ground Type drop-down is there, but the 2 options are greyed out and it will not let me select them(on the product page of the site). If I separately create 4 variations, 12oz wholebean $12.99, 12oz Ground $12.99, 16oz Wholebean etc etc it does work, but that seems like it defeats the purpose and is a lot of extra work so I assume it is a bug.

Variation Selectors Loose Value

When creating a variable product the variations loose their values after updating the product. Steps to reproduce.

Create a product called MacBook Pro
Set as Variable product type.
Add Attribute Size with values 13"|15"|17"

Add Variations for each size, configure price.

Publish or Update Product.

Dropdowns do not retain their values.

Monthly Sales in User Dashboard (WP)

If you login with a customer account using the standard WP login form it takes you to the WordPress Dashboard and that shows the monthly sales graph. Not sure if that is the total monthly sales or if it is just the customer's monthly sales, but that shouldn't be visible to customers if its total shop sales.

Prevent Default for # Login link in cart

When clicking the link in the cart : "Already registered? Click here to login" causes screen to jump to top.
Please add return false or e.preventDefault(); in the js.

Error when front page is shop

I'm getting the following error after I've set the shop page as my install's front page:

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'woocommerce_parse_query' was given in /home/gillesma/public_html/woocommerce/wp-includes/plugin.php on line 486

I'm assuming this is because there is no query in the URL when it's the homepage.

Don't use the file system to store sessions

Using PHP sessions will cause issues on multi-server deploys. They'll have to configure their load balancer to to sticky load balancing or else a shopper might lose their cart when they hit a different server. What you might do is see if they have a persistent object caching engine enabled, and if so, set a session storage handler that uses the WordPress object cache. The common scenario here is using Memcached as an object cache between multiple WP servers.

http://php.net/manual/en/function.session-set-save-handler.php

Pretty Coupon Type Names

On the coupons page, each coupon is listed with a coupon type that looks something like 'fixed_cart'. They should be the same as the drop down menu on the new coupon page.

Here's a fix, for admin-post-types.php, line 52:

replace this line:

echo $type;

with this:

$discount_types = apply_filters('woocommerce_coupon_discount_types', array(
'fixed_cart' => __('Cart Discount', 'woothemes'),
'percent' => __('Cart % Discount', 'woothemes'),
'fixed_product' => __('Product Discount', 'woothemes')
));
echo $discount_types[$type];

Alternatively you could define $discount_types somewhere else that can be shared with admin-post-types.php and writepanel-coupon_data.php.

Coupon Codes invalid

Testing with the latest commit.

coupons.class, line 64 asks:
if (sizeof( $this->product_ids )>0) :

But this always returns true, because line 37 pulls product_ids in like this:
$this->product_ids = array_map('trim', explode(',', get_post_meta($coupon->ID, 'product_ids', true)));

With this method, a blank string returns an array like this:
array( [0] -> '' );

This means that all coupon codes will always return invalid unless you have a product with the id of '' in your cart (which is impossible).

Here's my quick fix (in coupons.class, line 37), but I'm sure there's a better way of doing it:
$product_ids = get_post_meta($coupon->ID, 'product_ids', true);
$this->product_ids = $product_ids == '' ? array() : array_map('trim', explode(',', $product_ids));

Coupon code validation hook

Hey guys,

Thanks for adding hooks for new coupon types!

Can we add in a hook for coupon validation as well? Fairly simple stuff.

Here's some code that will do the job, for coupons.class, line 86 or so:

$valid = apply_filters('woocommerce_is_valid', true);
if (!$valid) return false;

Deleting Attribute from Product doesn't actually remove it

I was testing out attributes and I added a attribute to a product.

The attribute then showed up on the product page under "Additional Information".

I then deleted the variation as I didnt need it on that product and hit save but one the product page there was still the "Additional Information" Tab?

Admin screen handles are too generic

You may want to look into making the handles of the various admin screens less generic. For instance, "attributes" is far too generic. Better to prefix them with "woo-" or "wc-".

You'll see some strange bugs if another plugin is using the same handle. You don't want things like that rolling into support.

Jigoshop Shared Function Error

Just noticed with the 1.0.2 upgrade - if I have the Jigoshop plugin activated, I get this error:

Fatal error: Cannot redeclare is_shop() (previously declared in /bla/bla/bla/wp-content/plugins/jigoshop/jigoshop.php:415) in /bla/bla/bla/wp-content/plugins/woocommerce/woocommerce.php on line 239

Not sure if it's a big issue for you guys, since I can't see many people using both Jigo and Woo - but for developers who develop for both platforms it might be an issue.

woocommerce.css overrides WooThemes CSS

I know that WooCommerce is an out of the box plugin, and that it has no dependency on any of the WooThemes but if the WooCommerce front-end styles are enabled, the css overrides the standard button css (using Canvas).

The following removes the button image that is defined by Canvas, and other WooThemes.

woocommerce.css:49 a.button, button.button, input.button, #review_form #submit {color: white;background: #ff9c07;...}

Using background-color instead of background prevents it overriding any of the WooThemes CSS.

Message after clicking 'select options'

After clicking 'select options' on a variable product on category page, user is taken to product page with a message saying 'Please choose product options…'. Probably not necessary since we changed the button label.

Add custom currency

Just going through the plugin, and testing on an install, but noticed there is no way to add a custom currency, for example. South African Rand, it is not supported by PayPal, but it will be supported by Paygate, which I am writing the gateway for.

There is a filter for woocommerce_currencies but nothing I do to that filter seems to work correctly.

line-height in h1 - email notification

The line-height in the email notification h1 should be increased. It's not a big issue. When WooCommerce sends out a new order email the problem doesn't occur because the title stays on one line, but I use a debug feature in the Payson gateway and the title gets longer. When it spills over on a second line the text overlaps.

Hook for additional Coupon types

Hey guys - there doesn't seem to be any easy ways of adding additional coupon types at the moment.

The way I'm doing it right now is recreating the whole coupon admin meta box, and then extending the woocommerce_cart class to recreate the calculate_totals function, to which I'm only adding a few lines.

Can we find a better way of doing this?

Multiple Attribute Select

Here is my scenario:

I have 2 products in my catalog.

The first product has attributes of - Blue, Small, Medium, Large

Second Product has attributes of - White, Medium

In the attribute search (layered nav) I select White from the list. Great it picks out the Blue T-Shirt.

I want to go back so I uncheck Blue. I now have all the options:

REFINE BY SIZE

Large 1
Medium 2
Small 1

REFINE BY COLOUR

Blue 1
White 1

I want to now search for Medium AND Large t-shirts. I cant do this as it can only select one attribute.

My point is I want to be able to add multiple attributes to refine by. This would help in lots of scenarios.

For example I want a Medium, Red or Blue T-Shirt. I click all the attributes I want and it pulls back the results.

At the moment it is pritty fixed and I cant search for 2 attributes from the same list.

It would be good if we could make out own URLs ?filter_size=25&filter_colour=30,31 (That would be like Medium, Red, Blue)

Ive been testing this in Chrome.

Let me know your thoughts.

Cheers
Chris

Paypal Standard - Phone Number (US) issue

When filling out the shipping information with a US based phone number, aka 407-123-4567 and using Paypal Standard, the phone number gets passed into Paypal as 407 407 407. This was an existing issue with Jigoshop that was recently fixed, I vaguely remember they were saying it had something to do with US based formats and I believe they posted a fix for it under their forum.

*Edit: Found the public forum thread: http://jigoshop.com/topic/paypal-standardgateway-phone-number-bug/ *

Feature request: add password field to payment gateway generate_settings_html

Add option to be able to use password field in payment gateway settings page. If you need to enter payment gateway details like username and password the password shouldn't be visible on the settings page as a clear text field. It could be done individually in payment gateway plugin but best option is to have it as an option like the other ones (text, select etc.).

Multiple Variable Product UX Suggestions

Variable Product Pricing Adjustments

- There are a couple of issues I see with the current way variation pricing is being done that could be annoying/confusing for users depending on the complexity of the product. - First. A user can not see the price of the object, until they select all of their variation options. At this time they finally get their price, but they may not want that option after seeing the price, so they have to backtrack and change options randomly to see which ones affect price, and which ones do not. Without any indication when selecting your variation of price adjustments, this could get quite annoying for users. - For example: Product = Coffee. One variation is for bag size, 12oz, 16oz, 18oz, 24oz. Another variation is for Ground Type: full bean, ground, etc.. If each of the first variations offered a different price, a user would not be able to see those prices without first selecting BOTH variations and noticing the price. They would then have to go back and reselect both variations to see the new price etc.. - Taking a step back, I think it needs to work more like how other e-commerce solutions work. The product should always have a base price, aka $12.99 that should be entered in the system as the base price. The variations, "if" they add/decrease the price, should be listed accordingly in the drop-down variation selection so users know immediately of the increase/decrease before selecting. In the example above the drop-down would say something like "12oz, 14oz + $3.00, 16oz + $5.00, etc etc." and the price should be updated upon selection

Variations Reset on front-end if you adjust one:

- Another annoyance for a user is that all of the variation drop-downs reset if you make a change to the first one. In the example above, let’s say I picked 16oz, whole bean. I see my price as $16.99 instead of the $12.99 I was hoping for. I realize that I want the 12oz bag instead. If I change the variation to 12oz, it resets the second variation for ground type, causing me to have to reselect whole bean once again. - Imagine this with more than 2 variations, or for a tshirt, it could get extremely annoying.. I pick Medium for my shirt size, select the color blue, then select "ribbed style". I second guess myself and say maybe I should get a large to be safe. I now have to go back and reselect blue, then ribber style again. This does not seem ideal. But I can see some situations where this is necessary (4th point below)

Product Price ("From:") Anomolies:

- Real world scenario. I add a T-shirt as a product with two variations. One for size (S,M,L) , and one for color (Red, White, Blue). The t-shirt product has a price, it is $12.99, the variations do not affect price in any way. Since there is no "base price" parameter with Woocommerce for a variable product, I just set the variation to $12.99. When viewing the shop, or product detail page, the price says "From: $12.99" still, even though there are no other prices. - My thought is it needs to be reworked to only show "From" if there are multiple prices in the variations. Currently it looks like there is just a blanket statement saying "if the product is Variable, show From: in front of the lowest price"

Product Variations show up Even if out of stock

- Let's say for example I'm out of stock of my Large, Red, Ribbed tshirt. So I create a new variation option with it set to , large - red - ribbed, and enter a stock of 0. The problem is those options are still selectable for users from the drop-downs. Granted once I select them all it tells me "out of stock", but it seems like it would be better to hide those options on the fly if they aren't available, so a user doesn't waste time configuring a product that isn't even in stock. So once I selected, large, and then red, my final variation option would not list "ribbed" as an option since it was out of stock.. Or it could list it but greyed out with the words "out of stock" next to it? I've seen a lot of large online stores do things similar to this where the options adjust based on what you pick from the first box.

I realize none of these things are actual bugs, and some might not even be doable, or even worth doing. but I thought I'd bring them up to help foster some discussion moving forward.

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.