Few Question
hi
which row I should add to display product image on catalogue page? ProductImag or ProductThumbnail?
hi
which row I should add to display product image on catalogue page? ProductImag or ProductThumbnail?
Probably ProductImage if it's the standard eCart database structure you're using.
If working in PowerStore, I think I recall that the thumbnail is an auto result of the product image. I don't recall having to enter anything other than the main image. Can you share the link?
I am practicing on eCart locally. I downloaded database file from this link http://www.webassist.com/tutorials/Free-eCommerce-MySQL-Database
I need a tutorial how to add "Add to Cart" button
There are several tutorials at https://webassist.com/tutorials - type "add to cart" in the keyword search box. Also here: https://webassist.com/tutorials/eCommerce-Overview-eCommerce-Series. There also used to be a walkthrough video available but the link doesn't work any more - Patrice might know if it can still be accessed. The old link was http://connect.webassist.com/p53882011/
hi Mags
I have created Add To Cart button but when I click to test it its showing error I am attaching error snapshot kindly check it
I don't know enough about eCart to help with this, sorry. I did however upload your error message image to ChatGPT v4 and it came back with this:
The PHP error in the image indicates that the sizeof() function is being called with a null argument. This function requires a parameter that is either an array or a countable object, but in this case, it appears to be receiving a null value, which is causing the error.
Here’s a breakdown of the error message and the steps to fix it:
Error Details:
Error Type: TypeError
Error Message: sizeof(): Argument #1 ($value) must be of type Countable|array, null given
File: C:\wamp64\www\shopping-cart\WA_eCart\MyeCart_PHP.php
Line: 14
Steps to Fix:
Identify the Problem Line:
The error occurs on line 14 of MyeCart_PHP.php. You need to examine the code on this line to understand why a null value is being passed to sizeof().
Check the Code:
Open the MyeCart_PHP.php file and navigate to line 14. Look for the sizeof() function call and identify the variable being passed to it.
Validate the Variable:
Ensure that the variable being passed to sizeof() is properly initialized and is either an array or a countable object before the sizeof() function is called. If it's possible for the variable to be null, add a check to handle this case.
Example Fix:
Here's an example of how you might modify the code to prevent the error:
Original Code (Line 14 of MyeCart_PHP.php):
$cart_size = sizeof($items);
Modified Code:
$cart_size = is_array($items) ? sizeof($items) : 0;
In this modification, is_array($items) checks if $items is an array before calling sizeof(). If $items is not an array (which includes being null), it assigns 0 to $cart_size.
Additional Considerations:
Initialize Variables:
Ensure that $items is always initialized as an array or a countable object before it's used.
Debugging:
Add debugging statements to log the value of $items before line 14 to understand why it might be null.
Example Debugging:
if (!is_array($items)) {
error_log("Warning: \$items is not an array. Value: " . print_r($items, true));
}
$cart_size = is_array($items) ? sizeof($items) : 0;
By following these steps, you can resolve the TypeError and ensure that sizeof() is called with a valid argument. If you provide the relevant code snippet from MyeCart_PHP.php, I can offer more specific guidance tailored to your code.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.