Modify ↓
Opened 10 years ago
Closed 6 years ago
#842 closed Aufgabe (fixed)
ShoppingCart - bitte reset, each, list, while durch foreach ersetzen
| Reported by: | INETvisio | Owned by: | somebody |
|---|---|---|---|
| Priority: | niedrig | Milestone: | modified-shop-2.0.5.0 |
| Component: | Shop | Version: | 2.0.0.0 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
Hallo modified,
mit der Modulerweiterung habe ich ein Problem entdeckt, dass man die ShoppingCart-Funktionen bei der Preisanpassungen nicht nutzen darf. Sonst wird der ArrayZeiger zurückgesetzt und die Schleife kann Produkte verlieren.
Beispiel-Position:
Zeile 91:
//new module support
$sql_data_array = $this->shoppingCartModules->restore_contents_products_db($sql_data_array,$products_id,$this->table_basket,$qty,$this->type);
Wenn ein Modul eine Prüfung über die Produkte machen möchte, wird der ArrayZeiger verändert.
$product_ids = $_SESSION['cart']->get_product_id_list();
Mein Vorschlag wäre es, alle while-list-each Schleifen durch foreach Schleifen zu ersetzen. Foreach ist sicherer und schneller.
Beispiel:
suchen
if (is_array($this->contents)) {
reset($this->contents);
while (list ($products_id,) = each($this->contents)) {
ersetzen
if (is_array($this->contents)) {
foreach ($this->contents AS $products_id => $value) {
usw.
Gruß
Jürgen H.
Attachments (0)
Change History (3)
comment:1 by , 8 years ago
| Milestone: | modified-shop-2.1.0.0 |
|---|
comment:3 by , 6 years ago
| Milestone: | → modified-shop-2.0.5.0 |
|---|
comment:4 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

In 11561: