Skip to main content
The Shop class is a controller that manages various shop-related operations, including customer registration, cart management, checkout process, and order processing.

Class Properties

null
Protected property to store shop-related data.
string
Stripe secret key for payment processing.
string
Stripe public key for payment processing.
string
Prefix used for bill identification.
string
Token for ABEI API authentication.
string
URL for ABEI API endpoint.

Constructor

The constructor initializes the class, loads necessary models, and sets up important properties.

Methods

sendABEI

integer
The ID of the order to be sent to ABEI.
Sends order data to the ABEI API. This method is currently not fully implemented.

customer_registration

Loads the customer registration view.

register_customer

Handles the customer registration process.
boolean
Indicates whether the registration was successful.
string
Message describing the result of the registration process.

sendMailCustomerRegistration

array
Customer registration data.
string
Email address of the registered customer.
Sends a confirmation email to the newly registered customer.

confirm_registration

string
Confirmation token for the registration.
Confirms a customer’s registration using the provided token.

customer_login

Handles customer login process.
boolean
Indicates whether the login was successful.
string
Message describing the result of the login process.

customer_logout

Handles customer logout process.
boolean
Always returns true upon successful logout.

removePromoCode

Removes the applied promo code from the current session and cart.

addPromoCode

string
The promo code to be applied.
Applies a promo code to the current session.
boolean
Indicates whether the promo code was successfully applied.
string
Message describing the result of applying the promo code.

stripeWebhook

Handles Stripe webhook events for payment processing.

stripeInit

integer
The amount to be charged in cents.
integer
The ID of the order being processed.
string
A token for redirecting after payment.
Initializes a Stripe Checkout session.
string
The URL for the Stripe Checkout session.

load_view

string
The name of the view to be loaded.
array
Data to be passed to the view.
Loads a view with common data and settings.

getRandomInteger

integer
The minimum value of the range.
integer
The maximum value of the range.
Generates a random integer within the specified range.
integer
The generated random integer.

cart_view

Loads the cart view with current cart data and applied promotions.

checkout

Processes the checkout form submission and initiates the payment process.

clearCart

Clears the current cart and removes any applied promo code.

getCartItemCount

string
Optional message to be included in the response.
Returns the current number of items in the cart.
boolean
Always returns true.
string
The optional message passed to the method.
integer
The number of items in the cart.

getCartTotal

Returns the total value of items in the cart.
string
The total value of the cart, formatted as a string with two decimal places.

removeFromCart

string
The row ID of the item to be removed from the cart.
Removes an item from the cart.
boolean
Always returns true.
string
The row ID of the removed item.
integer
Always returns 0.
string
The new total value of the cart after removal.

addToCart

Adds an item to the cart.
integer
The ID of the product to be added.
integer
The quantity of the product to be added.
string
The type of the product being added.

updateItemCartQty

Updates the quantity of an item in the cart.
string
The row ID of the item to be updated.
integer
The change in quantity (positive or negative).
boolean
Always returns true.
string
The row ID of the updated item.
integer
The new quantity of the item.
string
The new total price for this item.
string
The new total net price for this item.
string
The new total tax for this item.
string
The new total value of the cart.

success

Handles the successful payment process.

notification

Handles payment notification process (not used in Stripe integration).

cancel

Handles cancelled payment process.

error

Handles payment error process.

pending

Handles pending payment process.

shop_response

string
The message to be displayed in the response.
Loads the shop response view with the given message.

sendOrderConfirmation

integer
The ID of the order to be confirmed.
string
The response from Amephias system.
boolean
Indicates whether the order includes a ticket.
Sends an order confirmation email to the shop.

sendOrderCustomer

integer
The ID of the order to be sent to the customer.
Sends an order confirmation email to the customer.

create_pdf_mail_new

Creates a PDF for a new order.

create_pdf_mail

Creates a PDF for an order (older version).

create_pdf_bill

Creates a PDF bill for an order.

create_pdf_bill_mail

Creates a PDF bill for an order to be sent via email.

dompdf_test

Generates a test PDF using dompdf library.

dompdf_test_save_to_file

Generates a test PDF using dompdf library and saves it to a file.