Shop Class

Ecommerce class

basket

array $shop->basket

Array of basket items

add_to_basket

$shop->add_to_basket( int $product, int $quantity=1, bool $buy_now=false)

Takes a product id and quantity and adds to the basket. If $buy_now is true - the user will be redirected to the basket.

set_delivery

$shop->set_delivery( dec $price )

Sets the current delivery price

prepare

int $shop->prepare()

Create an order with statu pending ready to go to the payment gateway. The order id is returned.

paypal_button

$shop->paypal_button( string $value='Pay using paypal click here' )

Outputs a paypal payment button.

worldpay_button

$shop->worldpay_button( string $value='Pay using worldpay click here' )

Outputs a worldpay payment button.