ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPaymentShoppingCart Class Reference
+ Collaboration diagram for ilPaymentShoppingCart:

Public Member Functions

 __construct ($user_obj)
 
 setSessionId ($a_session_id)
 
 getSessionId ()
 
 setPobjectId ($a_pobject_id)
 
 getPobjectId ()
 
 setPriceId ($a_price_id)
 
 getPriceId ()
 
 getEntries ($a_pay_method=0)
 
 setTotalAmount ($a_total_amount)
 
 getTotalAmount ()
 
 isInShoppingCart ($a_pobject_id)
 
 getEntry ($a_pobject_id)
 
 add ()
 
 update ($a_psc_id)
 
 delete ($a_psc_id)
 
 emptyShoppingCart ()
 
 getShoppingCart ($a_pay_method=0)
 
 getTotalAmountValue ($a_pay_method=0)
 
 getVat ($a_amount=0, $a_pobject_id=0)
 
 clearCouponItemsSession ()
 
 calcDiscountPrices ($coupons)
 

Static Public Member Functions

static _assignObjectsToUserId ($a_user_id)
 
static _migrateShoppingcart ($a_old_sessid, $a_new_sessid)
 
static _hasEntries ($a_user_id)
 
static _deleteExpiredSessionsPSC ()
 
static _deleteShoppingCartEntries ($a_pobject_id)
 
static getShoppingcartEntries ($a_paymethod=null)
 

Data Fields

 $user_obj = null
 
 $db = null
 
 $coupon_obj = null
 
 $sc_entries = array()
 
 $session_id =null
 
 $pobject_id = null
 
 $price_id = null
 
 $total_amount = null
 
 $vat_id = null
 
 $vat_rate = 0
 

Private Member Functions

 __deleteDoubleEntries ()
 
 __read ()
 

Detailed Description

Definition at line 16 of file class.ilPaymentShoppingCart.php.

Constructor & Destructor Documentation

◆ __construct()

ilPaymentShoppingCart::__construct (   $user_obj)

Definition at line 37 of file class.ilPaymentShoppingCart.php.

38 {
39 global $ilDB;
40
41 $this->user_obj = $user_obj;
42 $this->db = $ilDB;
43 $this->session_id = session_id();
44 $this->coupon_obj = new ilPaymentCoupons($this->user_obj);
45
46 $this->__deleteDoubleEntries();
47 $this->__read();
48 }
global $ilDB

References $ilDB, $user_obj, __deleteDoubleEntries(), and __read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __deleteDoubleEntries()

ilPaymentShoppingCart::__deleteDoubleEntries ( )
private

Definition at line 310 of file class.ilPaymentShoppingCart.php.

311 {
312 global $ilUser;
313 if(ANONYMOUS_USER_ID != $ilUser->getId())
314 {
315 $res = $this->db->queryf('
316 SELECT pobject_id, count(pobject_id) count FROM payment_shopping_cart
317 WHERE customer_id = %s
318 GROUP BY pobject_id',
319 array('integer'), array($this->user_obj->getId()));
320
321 while($row = $this->db->fetchAssoc($res))
322 {
323 if($row['count'] > 1)
324 {
325 $this->db->setLimit(1);
326 $this->db->manipulateF('
327 DELETE FROM payment_shopping_cart
328 WHERE customer_id = %s
329 AND pobject_id = %s',
330 array('integer','integer'),
331 array($this->user_obj->getId(),$row['pobject_id']));
332 }
333 }
334 }
335 }
global $ilUser
Definition: imgupload.php:15

References $ilUser, $res, and $row.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ __read()

ilPaymentShoppingCart::__read ( )
private

Definition at line 338 of file class.ilPaymentShoppingCart.php.

339 {
340 global $ilUser;
341 include_once './Services/Payment/classes/class.ilPaymentPrices.php';
342
343 $this->sc_entries = array();
344
345 if(isset($_SESSION['shop_user_id'])
346 && $_SESSION['shop_user_id'] != ANONYMOUS_USER_ID
347 || $this->user_obj->getId() != ANONYMOUS_USER_ID)
348 {
349 $res = $this->db->queryf('
350 SELECT * FROM payment_shopping_cart
351 WHERE customer_id = %s',
352 array('integer'), array($this->user_obj->getId()));
353 }
354 else if(ANONYMOUS_USER_ID == $ilUser->getId())
355 {
356 $res = $this->db->queryf('
357 SELECT * FROM payment_shopping_cart
358 WHERE session_id = %s',
359 array('text'), array($this->getSessionId()));
360 }
361
362 while($row = $this->db->fetchObject($res))
363 {
364 $this->sc_entries[$row->psc_id]["psc_id"] = $row->psc_id;
365 $this->sc_entries[$row->psc_id]["customer_id"] = $row->customer_id;
366 $this->sc_entries[$row->psc_id]["pobject_id"] = $row->pobject_id;
367 $this->sc_entries[$row->psc_id]["price_id"] = $row->price_id;
368 $this->sc_entries[$row->psc_id]['session_id'] = $row->session_id;
369 }
370
371 // Delete all entries with not valid prices or pay_method
372 unset($prices);
373 $prices = array();
374 foreach($this->sc_entries as $entry)
375 {
376 // check if price_id exists for pobject
377 if(!ilPaymentPrices::_priceExists($entry['price_id'],$entry['pobject_id']))
378 {
379 $this->delete($entry['psc_id']);
380 return false;
381 }
382
383 // check pay method
384 $tmp_pobj = new ilPaymentObject($this->user_obj, $entry['pobject_id']);
385
386 $pay_method = $tmp_pobj->getPayMethod();
387 if($pay_method == $tmp_pobj->PAY_METHOD_NOT_SPECIFIED)
388 {
389 $this->delete($entry['psc_id']);
390 return false;
391 }
392
393 // if payment is expired
394 if($tmp_pobj->getStatus() == $tmp_pobj->STATUS_EXPIRES)
395 {
396 $this->delete($entry['psc_id']);
397
398 return false;
399 }
400
401
402 $this->sc_entries[$entry['psc_id']]['pay_method'] = $pay_method;
403
404 $prices[] = array(
405 'id' => $entry['price_id'],
406 'pay_method' => $pay_method
407 );
408 unset($tmp_pobj);
409 }
410
411 // set total amount
412 $this->setTotalAmount(ilPaymentPrices::_getTotalAmount($prices ? $prices : array()));
413
414 $this->setPobjectId($entry['pobject_id']);
415
416 return true;
417 }
$_SESSION["AccountId"]
static _priceExists($a_price_id, $a_pobject_id)
static _getTotalAmount($a_price_ids)

References $_SESSION, $ilUser, $res, $row, ilPaymentPrices\_getTotalAmount(), ilPaymentPrices\_priceExists(), getSessionId(), setPobjectId(), and setTotalAmount().

Referenced by __construct(), add(), delete(), emptyShoppingCart(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _assignObjectsToUserId()

static ilPaymentShoppingCart::_assignObjectsToUserId (   $a_user_id)
static

Definition at line 105 of file class.ilPaymentShoppingCart.php.

106 {
107 global $ilDB;
108
109 $session_id = session_id();
110
111 $ilDB->update('payment_shopping_cart',
112 array('customer_id' => array('integer', (int) $a_user_id)),
113 array('session_id'=> array('text', $session_id)));
114
115 return true;
116 }

References $ilDB, and $session_id.

Referenced by ilShopShoppingCartGUI\__construct(), and ilShopShoppingCartGUI\forceShoppingCartRedirect().

+ Here is the caller graph for this function:

◆ _deleteExpiredSessionsPSC()

static ilPaymentShoppingCart::_deleteExpiredSessionsPSC ( )
static

Definition at line 573 of file class.ilPaymentShoppingCart.php.

574 {
575 global $ilDB;
576
577 $query = "DELETE FROM payment_shopping_cart "
578 . "WHERE psc_id IN "
579 . " (SELECT psc_id FROM payment_shopping_cart "
580 . " LEFT JOIN usr_session ON usr_session.session_id = payment_shopping_cart.session_id "
581 . " WHERE customer_id = %s AND usr_session.session_id IS NULL)";
582 $ilDB->manipulateF($query, array('integer'), array(ANONYMOUS_USER_ID));
583
584 }

References $ilDB, and $query.

◆ _deleteShoppingCartEntries()

static ilPaymentShoppingCart::_deleteShoppingCartEntries (   $a_pobject_id)
static

Definition at line 586 of file class.ilPaymentShoppingCart.php.

587 {
588 global $ilDB;
589
590 $ilDB->manipulateF('
591 DELETE FROM payment_shopping_cart
592 WHERE pobject_id = %s',
593 array('integer'), array($a_pobject_id));
594 }

References $ilDB.

Referenced by ilPaymentObjectGUI\updateDetails().

+ Here is the caller graph for this function:

◆ _hasEntries()

static ilPaymentShoppingCart::_hasEntries (   $a_user_id)
static

Definition at line 286 of file class.ilPaymentShoppingCart.php.

287 {
288 global $ilDB, $ilUser;
289
290 if(ANONYMOUS_USER_ID == $ilUser->getId())
291 {
292 $res = $ilDB->queryf('
293 SELECT * FROM payment_shopping_cart
294 WHERE session_id = %s',
295 array('text'), array(self::getSessionId()));
296 }
297 else
298 {
299 $res = $ilDB->queryf('
300 SELECT * FROM payment_shopping_cart
301 WHERE customer_id = %s',
302 array('integer'), array($a_user_id));
303 }
304
305 return $ilDB->numRows($res) ? true : false;
306 }

References $ilDB, $ilUser, and $res.

◆ _migrateShoppingcart()

static ilPaymentShoppingCart::_migrateShoppingcart (   $a_old_sessid,
  $a_new_sessid 
)
static

Definition at line 118 of file class.ilPaymentShoppingCart.php.

119 {
120 global $ilDB;
121
122 $ilDB->update('payment_shopping_cart',
123 array('session_id' => array('text', $a_new_sessid)),
124 array('session_id'=> array('text', $a_old_sessid)));
125
126 }

References $ilDB.

◆ add()

ilPaymentShoppingCart::add ( )

Definition at line 184 of file class.ilPaymentShoppingCart.php.

185 {
186 global $ilUser;
187
188 if(ANONYMOUS_USER_ID == $ilUser->getId())
189 {
190 // Delete old entries for same pobject_id
191 $statement = $this->db->manipulateF('
192 DELETE FROM payment_shopping_cart
193 WHERE session_id = %s
194 AND pobject_id = %s',
195 array('integer', 'integer'),
196 array($this->getSessionId(), $this->getPobjectId()));
197
198 }
199 else
200 {
201 // Delete old entries for same pobject_id
202 $statement = $this->db->manipulateF('
203 DELETE FROM payment_shopping_cart
204 WHERE customer_id = %s
205 AND pobject_id = %s',
206 array('integer', 'integer'),
207 array($this->user_obj->getId(), $this->getPobjectId()));
208 }
209
210 $next_id = $this->db->nextId('payment_shopping_cart');
211
212 $this->db->insert('payment_shopping_cart',
213 array('psc_id' => array('integer', $next_id),
214 'customer_id'=> array('integer', $this->user_obj->getId()),
215 'pobject_id' => array('integer', $this->getPobjectId()),
216 'price_id' => array('integer', $this->getPriceId()),
217 'session_id' => array('text', $this->getSessionId()))
218 );
219
220 $this->__read();
221
222 return true;
223 }

References $ilUser, __read(), getPobjectId(), getPriceId(), and getSessionId().

+ Here is the call graph for this function:

◆ calcDiscountPrices()

ilPaymentShoppingCart::calcDiscountPrices (   $coupons)

Definition at line 538 of file class.ilPaymentShoppingCart.php.

539 {
540 if (is_array($coupons))
541 {
542 $r_items = array();
543
544 foreach ($coupons as $coupon)
545 {
546 $this->coupon_obj->setId($coupon['pc_pk']);
547 $this->coupon_obj->setCurrentCoupon($coupon);
548
549 if (is_array($coupon['items']) && $coupon['total_objects_coupon_price'] > 0)
550 {
551 $bonus = ($this->coupon_obj->getCouponBonus($coupon['total_objects_coupon_price']));
552
553 foreach ($coupon['items'] as $item)
554 {
555 if (!array_key_exists($item['pobject_id'], $r_items))
556 {
557 $r_items[$item['pobject_id']] = $item;
558 $r_items[$item['pobject_id']]['discount_price'] = (float) $item['math_price'];
559 }
560
561 $ratio = (float) $item['math_price'] / $coupon['total_objects_coupon_price'];
562 $r_items[$item['pobject_id']]['discount_price'] += ($ratio * $bonus * (-1));
563 }
564 }
565 }
566
567 return $r_items;
568 }
569
570 return array();
571 }

◆ clearCouponItemsSession()

ilPaymentShoppingCart::clearCouponItemsSession ( )

Definition at line 520 of file class.ilPaymentShoppingCart.php.

521 {
522 if (!empty($_SESSION['coupons']))
523 {
524 foreach ($_SESSION['coupons'] as $payment_type => $coupons_array)
525 {
526 if (is_array($coupons_array))
527 {
528 foreach ($coupons_array as $coupon_key => $coupon)
529 {
530 $_SESSION['coupons'][$payment_type][$coupon_key]['total_objects_coupon_price'] = 0.0;
531 $_SESSION['coupons'][$payment_type][$coupon_key]['items'] = array();
532 }
533 }
534 }
535 }
536 }

References $_SESSION.

◆ delete()

ilPaymentShoppingCart::delete (   $a_psc_id)

Definition at line 251 of file class.ilPaymentShoppingCart.php.

252 {
253 $statement = $this->db->manipulateF('
254 DELETE FROM payment_shopping_cart
255 WHERE psc_id = %s',
256 array('integer'), array($a_psc_id));
257
258 $this->__read();
259 }

References __read().

+ Here is the call graph for this function:

◆ emptyShoppingCart()

ilPaymentShoppingCart::emptyShoppingCart ( )

Definition at line 261 of file class.ilPaymentShoppingCart.php.

262 {
263 global $ilUser;
264 if(ANONYMOUS_USER_ID == $ilUser->getId())
265 {
266 $statement = $this->db->manipulateF('
267 DELETE FROM payment_shopping_cart
268 WHERE session_id = %s',
269 array('text'), array($this->getSessionId())
270 );
271 }
272 else
273 {
274 $statement = $this->db->manipulateF('
275 DELETE FROM payment_shopping_cart
276 WHERE customer_id = %s',
277 array('integer'), array($this->user_obj->getId())
278 );
279 }
280 $this->__read();
281
282 return true;
283 }

References $ilUser, __read(), and getSessionId().

+ Here is the call graph for this function:

◆ getEntries()

ilPaymentShoppingCart::getEntries (   $a_pay_method = 0)

Definition at line 77 of file class.ilPaymentShoppingCart.php.

78 {
79 if ($a_pay_method == 0)
80 {
81 return $this->sc_entries ? $this->sc_entries : array();
82 }
83 else
84 {
85 $tmp_entries = array();
86 foreach($this->sc_entries as $entry)
87 {
88 if ($entry['pay_method'] == $a_pay_method)
89 {
90 $tmp_entries[$entry['psc_id']] = $entry;
91 }
92 }
93 return $tmp_entries;
94 }
95 }

Referenced by getShoppingCart().

+ Here is the caller graph for this function:

◆ getEntry()

ilPaymentShoppingCart::getEntry (   $a_pobject_id)

Definition at line 155 of file class.ilPaymentShoppingCart.php.

156 {
157 global $ilUser;
158
159 if(ANONYMOUS_USER_ID == $ilUser->getId())
160 {
161 $res = $this->db->queryf('
162 SELECT * FROM payment_shopping_cart
163 WHERE session_id = %s
164 AND pobject_id = %s',
165 array('text', 'integer'),
166 array($this->getSessionId(), $a_pobject_id));
167 }
168 else
169 {
170 $res = $this->db->queryf('
171 SELECT * FROM payment_shopping_cart
172 WHERE customer_id = %s
173 AND pobject_id = %s',
174 array('integer', 'integer'),
175 array($this->user_obj->getId(), $a_pobject_id));
176 }
177 if (is_object($res))
178 {
179 return $this->db->fetchAssoc($res);
180 }
181 return array();
182 }

References $ilUser, $res, and getSessionId().

+ Here is the call graph for this function:

◆ getPobjectId()

ilPaymentShoppingCart::getPobjectId ( )

Definition at line 64 of file class.ilPaymentShoppingCart.php.

References $pobject_id.

Referenced by add(), and update().

+ Here is the caller graph for this function:

◆ getPriceId()

ilPaymentShoppingCart::getPriceId ( )

Definition at line 72 of file class.ilPaymentShoppingCart.php.

References $price_id.

Referenced by add(), and update().

+ Here is the caller graph for this function:

◆ getSessionId()

ilPaymentShoppingCart::getSessionId ( )

Definition at line 55 of file class.ilPaymentShoppingCart.php.

56 {
57 return $this->session_id;
58 }

References $session_id.

Referenced by __read(), add(), emptyShoppingCart(), getEntry(), isInShoppingCart(), and update().

+ Here is the caller graph for this function:

◆ getShoppingCart()

ilPaymentShoppingCart::getShoppingCart (   $a_pay_method = 0)

Definition at line 419 of file class.ilPaymentShoppingCart.php.

420 {
421
422 if(!count($items = $this->getEntries($a_pay_method)))
423 {
424 return 0;
425 }
426
427 $counter = 0;
428 $f_result = array();
429 foreach($items as $item)
430 {
431 $tmp_pobject = new ilPaymentObject($this->user_obj,$item['pobject_id']);
432
433 $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject->getRefId(), false);
434
435 $f_result[$counter]["psc_id"] = $item['psc_id'];
436 $f_result[$counter]["pobject_id"] = $item['pobject_id'];
437 if($tmp_obj)
438 {
439 $f_result[$counter]["obj_id"] = $tmp_obj->getId();
440 $f_result[$counter]["type"] = $tmp_obj->getType();
441 $f_result[$counter]["object_title"] = $tmp_obj->getTitle();
442 }
443 else
444 {
445 global $lng;
446 $f_result[$counter]["obj_id"] = '';
447 $f_result[$counter]["type"] = '';
448 $f_result[$counter]["object_title"] = $lng->txt('object_deleted');
449 }
450
451 $price_data = ilPaymentPrices::_getPrice($item['price_id']);
452 $price_string = ilPaymentPrices::_getPriceString($item['price_id']);
453
454 $price = number_format($price_data['price'], 2, '.', '');
455
456 $f_result[$counter]["price"] = $price;
457 $f_result[$counter]["price_string"] = $price_string;
458 $f_result[$counter]['extension'] = $price_data['extension'];
459
460 require_once './Services/Payment/classes/class.ilShopVats.php';
461 $oVAT = new ilShopVats((int)$tmp_pobject->getVatId());
462 $f_result[$counter]['vat_rate'] = $oVAT->getRate();
463 $f_result[$counter]['vat_unit'] = $tmp_pobject->getVat($price);
464
465 $f_result[$counter]["duration"] = $price_data["duration"];
466 $f_result[$counter]['unlimited_duration'] = $price_data['unlimited_duration'];
467
468 $f_result[$counter]["price_type"] = $price_data["price_type"];
469 $f_result[$counter]["duration_from"] = $price_data["duration_from"];
470 $f_result[$counter]["duration_until"] = $price_data["duration_until"];
471 $f_result[$counter]["description"] = $price_data["description"];
472 unset($tmp_obj);
473 unset($tmp_pobject);
474
475 ++$counter;
476 }
477 return $f_result;
478 }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _getPriceString($a_price_id)
static _getPrice($a_price_id)
Class ilShopVats.
global $lng
Definition: privfeed.php:40

References $lng, ilPaymentPrices\_getPrice(), ilPaymentPrices\_getPriceString(), getEntries(), and ilObjectFactory\getInstanceByRefId().

Referenced by getTotalAmountValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShoppingcartEntries()

static ilPaymentShoppingCart::getShoppingcartEntries (   $a_paymethod = null)
static
Parameters
integer | null$a_paymethod
Returns
bool

Definition at line 601 of file class.ilPaymentShoppingCart.php.

602 {
603 global $ilUser, $ilDB;
604
605 $user_id = $ilUser->getId();
606
607 if($user_id == ANONYMOUS_USER_ID)
608 {
609 return false;
610 }
611 else
612 {
613 if($a_paymethod != null)
614 {
615 $res = $ilDB->queryF('
616 SELECT psc_id, ref_id, vat_rate, duration, currency, price, unlimited_duration, extension, duration_from, duration_until, description,price_type, pay_method
617 FROM payment_shopping_cart psc
618 LEFT JOIN payment_prices pp ON psc.price_id
619 LEFT JOIN payment_objects po ON psc.pobject_id
620 LEFT JOIN payment_vats pv ON po.vat_id
621 WHERE customer_id = %s
622 AND status = %s
623 AND pay_method = %s',
624 array('integer', 'integer', 'integer'), array($user_id, 1, $a_paymethod));
625 }
626 else
627 {
628 // select all entries for current user
629 $res = $ilDB->queryF('
630 SELECT psc_id, ref_id, vat_rate, duration, currency, price, unlimited_duration, extension, duration_from, duration_until, description, price_type, pay_method
631 FROM payment_shopping_cart psc
632 LEFT JOIN payment_prices pp ON psc.price_id
633 LEFT JOIN payment_objects po ON psc.pobject_id
634 LEFT JOIN payment_vats pv ON po.vat_id
635 WHERE customer_id = %s
636 AND status = %s',
637 array('integer', 'integer'), array($user_id, 1));
638 }
639
640 $entries = array();
641 while($row = $ilDB->fetchAssoc($res))
642 {
643 $entries[] = $row;
644 }
645 return $entries;
646 }
647 }

References $ilDB, $ilUser, $res, and $row.

◆ getTotalAmount()

ilPaymentShoppingCart::getTotalAmount ( )

Definition at line 100 of file class.ilPaymentShoppingCart.php.

References $total_amount.

◆ getTotalAmountValue()

ilPaymentShoppingCart::getTotalAmountValue (   $a_pay_method = 0)

Definition at line 480 of file class.ilPaymentShoppingCart.php.

481 {
482 $amount = 0.0;
483
484 if (is_array($result = $this->getShoppingCart($a_pay_method)))
485 {
486 for ($i = 0; $i < count($result); $i++)
487 {
488 $amount += $result[$i]["price"];
489 }
490 }
491 return (float) $amount;
492 }
$result

References $result, and getShoppingCart().

+ Here is the call graph for this function:

◆ getVat()

ilPaymentShoppingCart::getVat (   $a_amount = 0,
  $a_pobject_id = 0 
)

Definition at line 494 of file class.ilPaymentShoppingCart.php.

495 {
496 global $ilDB;
497
498 include_once './Services/Payment/classes/class.ilShopVats.php';
499
500 $res = $ilDB->queryF('
501 SELECT * FROM payment_objects WHERE pobject_id = %s',
502 array('integer'), array($a_pobject_id));
503
504 while($row = $ilDB->fetchObject($res))
505 {
506 $this->vat_id = $row->vat_id;
507 }
508
509 $res = $ilDB->queryF('
510 SELECT * FROM payment_vats WHERE vat_id = %s',
511 array('integer'),array($this->vat_id));
512
513 while($row = $ilDB->fetchObject($res))
514 {
515 $this->vat_rate = $row->vat_rate;
516 }
517 return (float) ($a_amount - (round(($a_amount / (1 + ($this->vat_rate / 100.0))) * 100) / 100));
518 }

References $ilDB, $res, and $row.

◆ isInShoppingCart()

ilPaymentShoppingCart::isInShoppingCart (   $a_pobject_id)

Definition at line 128 of file class.ilPaymentShoppingCart.php.

129 {
130 global $ilUser;
131
132 $session_id = $this->getSessionId();
133
134 if(ANONYMOUS_USER_ID == $ilUser->getId())
135 {
136 $res = $this->db->queryf('
137 SELECT * FROM payment_shopping_cart
138 WHERE session_id = %s
139 AND pobject_id = %s',
140 array('text', 'integer'),
141 array($session_id, $a_pobject_id));
142 }
143 else
144 {
145 $res = $this->db->queryf('
146 SELECT * FROM payment_shopping_cart
147 WHERE customer_id = %s
148 AND pobject_id = %s',
149 array('integer', 'integer'),
150 array($this->user_obj->getId(), $a_pobject_id));
151 }
152 return $res->numRows() ? true : false;
153 }

References $ilUser, $res, $session_id, and getSessionId().

+ Here is the call graph for this function:

◆ setPobjectId()

ilPaymentShoppingCart::setPobjectId (   $a_pobject_id)

Definition at line 60 of file class.ilPaymentShoppingCart.php.

61 {
62 $this->pobject_id = $a_pobject_id;
63 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setPriceId()

ilPaymentShoppingCart::setPriceId (   $a_price_id)

Definition at line 68 of file class.ilPaymentShoppingCart.php.

69 {
70 $this->price_id = $a_price_id;
71 }

◆ setSessionId()

ilPaymentShoppingCart::setSessionId (   $a_session_id)

Definition at line 50 of file class.ilPaymentShoppingCart.php.

51 {
52 $this->session_id = $a_session_id;
53 }

◆ setTotalAmount()

ilPaymentShoppingCart::setTotalAmount (   $a_total_amount)

Definition at line 96 of file class.ilPaymentShoppingCart.php.

97 {
98 $this->total_amount = $a_total_amount;
99 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ update()

ilPaymentShoppingCart::update (   $a_psc_id)

Definition at line 225 of file class.ilPaymentShoppingCart.php.

226 {
227 global $ilUser;
228 if(ANONYMOUS_USER_ID == $ilUser->getId())
229 {
230 $this->db->update('payment_shopping_cart',
231 array('pobject_id'=> array('integer', $this->getPobjectId()),
232 'price_id' => array('integer', $this->getPriceId()),
233 'session_id'=> array('text', $this->getSessionId())),
234 array('psc_id' => array('integer', (int)$a_psc_id)));
235
236 }
237 else
238 {
239 $this->db->update('payment_shopping_cart',
240 array('customer_id' => array('integer', $this->user_obj->getId()),
241 'pobject_id' => array('integer', $this->getPobjectId()),
242 'price_id' => array('integer', $this->getPriceId()),
243 'session_id' => array('text', $this->getSessionId())),
244 array( 'psc_id' => array('integer', (int)$a_psc_id)));
245 }
246 $this->__read();
247
248 return true;
249 }

References $ilUser, __read(), getPobjectId(), getPriceId(), and getSessionId().

+ Here is the call graph for this function:

Field Documentation

◆ $coupon_obj

ilPaymentShoppingCart::$coupon_obj = null

Definition at line 24 of file class.ilPaymentShoppingCart.php.

◆ $db

ilPaymentShoppingCart::$db = null

Definition at line 22 of file class.ilPaymentShoppingCart.php.

◆ $pobject_id

ilPaymentShoppingCart::$pobject_id = null

Definition at line 29 of file class.ilPaymentShoppingCart.php.

Referenced by getPobjectId().

◆ $price_id

ilPaymentShoppingCart::$price_id = null

Definition at line 30 of file class.ilPaymentShoppingCart.php.

Referenced by getPriceId().

◆ $sc_entries

ilPaymentShoppingCart::$sc_entries = array()

Definition at line 26 of file class.ilPaymentShoppingCart.php.

◆ $session_id

ilPaymentShoppingCart::$session_id =null

◆ $total_amount

ilPaymentShoppingCart::$total_amount = null

Definition at line 31 of file class.ilPaymentShoppingCart.php.

Referenced by getTotalAmount().

◆ $user_obj

ilPaymentShoppingCart::$user_obj = null

Definition at line 21 of file class.ilPaymentShoppingCart.php.

Referenced by __construct().

◆ $vat_id

ilPaymentShoppingCart::$vat_id = null

Definition at line 32 of file class.ilPaymentShoppingCart.php.

◆ $vat_rate

ilPaymentShoppingCart::$vat_rate = 0

Definition at line 33 of file class.ilPaymentShoppingCart.php.


The documentation for this class was generated from the following file: