Coder Social home page Coder Social logo

silvershop-shipping's People

Contributors

anhld avatar antonythorpe avatar bummzack avatar ctx2002 avatar jedateach avatar jeffwhitfield avatar mohamedallou avatar nimeso avatar rotassator avatar rvxd avatar sanderha avatar sebastiand avatar slievr avatar sn4h avatar thebnl avatar wernerkrauss avatar wilr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

silvershop-shipping's Issues

setShippingMethod should not rely on an address being present.

Consider the following use-case:

  • Shop ships to one country only
  • Shipping cost is only calculated by quantity or total order-value

In the above case, the shipping modifier could be applied to an order before a user-address is present. It could even show the actual shipping cost inside the cart, at a time where the user-address might be unknown.

My proposal would be to implement a requiresAddress method for each ShippingMethod implementation. ZonedShipping and DistanceShipping would obivously simply return true, but TableShipping could return either true or false.

Should I try to implement this change?

Issue with latest version of vendor/willdurand Geocoder (had to downgrade)

Brand new composer install and I get this error

I get this error
Cannot instantiate interface Geocoder\Geocoder in D:\wamp\www\mysite\shop_geocoding\code\AddressGeocoding.php on line 35

UPDATE:
If i use an older version of vendor/willdurand Geocoder it works.... hmmmm
It looks like he has done a major bit of work in the last wee while and maybe the name spaces are messed up?

https://github.com/geocoder-php/Geocoder

Have a great weekend.
:)

Auto-apply shipping if only one option

If only one shipping option available for the cart, eg if there is a table rate shipping defined by value, can that be automatically applied. Seems like from a user pov the shippingmethod step is unnecessary.

This module should not rely on constants defined in the core module.

There are some constants being defined in _config.php that rely on constants from the core module. We should remove those, because it relies on the fact that the _config.php file from the core module gets loaded first. Not sure where/why these constants are being used anyway.

SS3 branch - Problem with ShippingMethod#CalculatedRate NOT calculatedRate

It seems we have some weird issues with upgrading from

Object::add_extension("ComponentSet","OrderItemList"); to
Object::add_extension("DataList","OrderItemList"); this should be HasManyList I think but had issues

the problem is in ShippingEstimator when we call

function getEstimates(){
        if($this->calculated){
            return $this->estimates;
        }
        $output = new ArrayList(); // Had to use ArrayList because you can't add CalculatedRate to a DataList ??????
        if($options = $this->getShippingMethods()){
            foreach($options as $option){
                $option->CalculatedRate = $option->calculateRate($this->package, $this->address);
                if($option->CalculatedRate !== null){
                    $output->add($option);
                }
            }
        }
        $output->sort("CalculatedRate","ASC"); //sort by rate, lowest to highest
        // cache estimates
        $this->estimates = $output;
        $this->calculated = true;
        return $output;
    }

What is strange is that when I am at the CheckoutStep_ShippingMethod it works and passes me the correct CalculatedRate but when I go to the payment step it returns null

Bug introduced in #61

in #61 @RVXD changed the value taken for calculating shipping costs to order's "Total" instead of SubTotal.

This introduces a bug when using TableShippingRates and stepped checkout.

Imagine a SubTotal of 75,-
Under 80,- we have a shipping fee of 10,-
Now the Total is 85,- and saved to the order object.

In the next step it calculates the shipping fee again, but now it uses the saved Total of 85,- to calculate it. Unfortunately this is just above free shipping limit.

The user sees a total calculated ammount of 75,- (Subtotal and no shipping), but internally the order is still worth 85,- .

Now the problems are really starting: The customer is sent to the payment gateway to pay the last calculated amount of 75,-, the order is not fully paid.

IMHO we should revert #61 and the discounts module should modify the value of "createShippingPackage" using the provided hook "updateShippingPackage"

root 'shop' ProductCategory / access issue

After doing a 'PopulateShopTask' it creates a Category in the root called 'Shop'. If I try and view this page via mysite/shop it just returns

Forbidden
You don't have permission to access /shop/ on this server.

The other Categories and shop pages seem fine

Stepped checkout not appearing (shipping cost not calculated at checkout)

Hi there,

I've set up SilverShop with the shipping, I can get an estimate calculated in the cart and I have the line "Shipping" appearing in the checkout subtotal calculation. So everything should be fine, though despite using the recommended settings in config.yml and removing the line if($checkoutsteps = CheckoutPage::config()->steps){SteppedCheckoutExtension::setupSteps($checkoutsteps);} in config.php, I still can't get the stepped checkout to work properly

This is the config.yml snippet used:

SilverShop\Model\Order:
modifiers:
- SilverShop\Shipping\ShippingFrameworkModifier

SilverShop\Page\CheckoutPage:
steps:
'membership': 'CheckoutStep_Membership'
'contactdetails': 'CheckoutStep_ContactDetails'
'shippingaddress': 'CheckoutStep_Address'
'billingaddress': 'CheckoutStep_Address'
'shippingmethod': 'CheckoutStep_ShippingMethod' #extra line for shipping method
'paymentmethod': 'CheckoutStep_PaymentMethod'
'summary': 'CheckoutStep_Summary'

I also join two screenshots.
Brave BrowserSnapz014
Brave BrowserSnapz015

   I tried everything under the sun, so not sure if that's me not setting it up properly or else.

Regards,
Gaets for Digitweaks

Error when creating the first Shipping Method

Hi There,

I'm on SS5.1 with SilverShop 4, PHP 8.1

When creating the first Shipping Method, there's an error making it impossible to save that first Shipping Method due to the getTitle()

[2024-03-25T02:15:44.637300+01:00] error-log.WARNING: E_DEPRECATED: number_format(): Passing null to parameter #1 ($num) of type float is deprecated {"code":8192,"message":"number_format(): Passing null to parameter #1 ($num) of type float is deprecated","file":"/home/******/store_dev/vendor/silvershop/shipping/src/Model/ShippingMethod.php","line":57} []

My workaround has been to set $rate as null then check if there's a $Rate set so at least we can create the Shipping Method then set the Rate and from there the error isn't reproduced.

public function getTitle()
{

    $rate = null;

    if($this->Rate != null){
        
        $rate = number_format(
        $this->Rate,
        2,
        ShopCurrency::config()->decimal_delimiter,
        ShopCurrency::config()->thousand_delimiter 
        );
    }
    else $rate = 0;
    

    if (ShopCurrency::config()->append_symbol) {
        $rate = $rate . ' ' . ShopCurrency::config()->currency_symbol;
    } else {
        $rate = ShopCurrency::config()->currency_symbol . $rate;
    }

    $title = implode(" - ", array_filter([
        $rate,
        $this->Name,
        $this->Description
    ]));

    $this->extend('updateTitle', $title);
    return $title;
}

Shipping address issue

I have an ajax call, the call uses following code to get $shipping object:

$method = ShippingMethod::get()->filter(array("ID" => $id))->first();
$order = ShoppingCart::curr();
$shipping = $method->getCalculator($order)->calculate();

above was working with old burnbright/shop module, since the old module was no longer supported,
I have changed to use silvershop/core.

Now there is a problem,

for ShippingCalculator class, to get address, it uses following line:

$this->order->ShippingAddress()

I think it should change to getShippingAddress.
In older version of Order class, ShippingAddress is correct way to fetch address,

Fatal error When adding Warehouse

hello
could you advise please!
im getting an error when trying to add a Warehouse

Fatal error: Class 'SilverStripe\Forms\GridField\GridField' not found in C:\wamp\www\myshop\hasonefield\code\HasOneButtonField.php on line 13

i have now SilverStripe 3.6
below is my info of what i got

"require": {
"php": ">=5.3.3",
"silverstripe/cms": "^3.1",
"silverstripe/framework": "^3.1",
"silverstripe/reports": "^3.1",
"silverstripe/siteconfig": "^3.1",
"silvershop/core": "^2.2",
"burnbright/omnipay-paystation": "~2.0",
"omnipay/paymentexpress": "~2.0",
"unclecheese/betterbuttons": "1.2.",
"silverstripe/googlesitemaps": "^1.5",
"silverstripe/userforms": "
",
"silverstripe/blog": "2.@dev",
"silverstripe/comments": "^2.1",
"ezyang/htmlpurifier": "dev-master",
"thisisbd/silverstripe-maintenance-mode": "
",
"heyday/silverstripe-menumanager": "~2.1.0",
"silvershop/shipping": "master"
},

Composer dependencies cause duplicate install of SilverStripe Shop

This module's Composer dependencies include "burnbright/silverstripe-shop-geocoding": "~1.2,. Even the most recent published version of this package, 1.2.3, is almost 2 years old and has a dependency on the old "burnbright/silverstripe-shop": "*" which causes a duplicate install of SilverStripe Shop.

The burnbright/silverstripe-shop-geocoding repository has been updated to fix this but a new version has not yet been published.

Suggest changing this dependency to "burnbright/silverstripe-shop-geocoding": "dev-master" until a new version of burnbright/silverstripe-shop-geocoding is published.

Issue with latest version of vendor/willdurand Geocoder (had to downgrade)

Brand new composer install and I get this error

I get this error
Cannot instantiate interface Geocoder\Geocoder in D:\wamp\www\mysite\shop_geocoding\code\AddressGeocoding.php on line 35

UPDATE:
If i use an older version of vendor/willdurand Geocoder it works.... hmmmm
It looks like he has done a major bit of work in the last wee while and maybe the name spaces are messed up?

https://github.com/geocoder-php/Geocoder

Have a great weekend.
:)

Include "$" in front of available shipping options

Shipping options currently display just "Price - Title - Description", e.g. "10.00 - Standard Shipping - Description". To avoid any potential confusion, it should include a dollar sign in front of the price, e.g. "$10.00 - Standard Shipping - Description".

Requiring Silverstripe Shop

Hi there,

I am trying to require the updated version of the shipping module.

composer require silvershop/silvershop-shipping:master

I am having trouble requiring the module. Getting the following error when I run the command:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package silvershop/silvershop-shipping could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I can require via 'composer require silvershop/shipping'. However the version this installs is not up to date.

Best regards,
James

[Deprecated] Creation of dynamic property SilverShop\Shipping\ShippingPackage::$shape is deprecated

I am using Silverstripe 5.1, silvershop 4.0, and silvershop-shipping 3.0 on PHP 8.1

After adding the table rate shipping and doing a test checkout, upon reaching the shipping method page. I am receiving this bunch of errors.

[Deprecated] Creation of dynamic property SilverShop\Shipping\ShippingPackage::$shape is deprecated
[Deprecated] Creation of dynamic property SilverShop\Shipping\ShippingPackage::$weightunit is deprecated
[Deprecated] Creation of dynamic property SilverShop\Shipping\ShippingPackage::$widthunit is deprecated
[Emergency] Uncaught InvalidArgumentException: Invalid sort column LENGTH("SilverShop_RegionRestriction"."PostalCode")

Shipping estimator and shipping step doesnt work SS 4.2 PHP 7

When I use table shipping and include the shipping estimator form and have shipping as one of my steps in check out I get this error.

No core has been touched and it was installed via composer.

``[Notice] Array to string conversion
POST /cart/ShippingEstimateForm/

98 // also include a special case where all constraints are empty
99 $emptyconstraint[] = "($mincol = 0 AND $maxcol = 0)";
100 }
101
102 $constraintfilters[] = "(" . implode(" AND ", $emptyconstraint) . ")";
103
104 $filter = "(" . implode(") AND (", [
105 ""ShippingMethodID" = " . $this->ID,
106 RegionRestriction::getAddressFilters(),
107 implode(" OR ", $constraintfilters) //metrics restriction
108 ]) . ")";
109
110 $tr = TableShippingRate::get()->where($filter)->sort("LENGTH("SilverShop_RegionRestriction"."PostalCode") DESC, "SilverShop_TableShippingRate"."Rate" ASC")->first();
111
112 if ($tr) {
113 $rate = $tr->Rate;``

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.