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.
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.
confirm_registration
string
Confirmation token for the registration.
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.
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.
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.
getRandomInteger
integer
The minimum value of the range.
integer
The maximum value of the 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.
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.
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.
sendOrderConfirmation
integer
The ID of the order to be confirmed.
string
The response from Amephias system.
boolean
Indicates whether the order includes a ticket.
sendOrderCustomer
integer
The ID of the order to be sent to the customer.