Zum Inhalt springen
PCG Team Logo

PCG Team

Software für Lebensmittel-Lieferbetriebe

  • Startseite
  • Blog
  • Kontakt
  • Deutsch
    • English
    • Français
    • Español

PC Gärtner

2
  • Artikel-Stamm
  • Basismodule

PCG API

1
  • API Optionen

Low Level API

3
  • Proxy
  • Data Lists
  • API Konzepte

Javascript Building Blocks

1
  • Warenkorb-Komponente
View Categories
  • Home
  • Docs
  • PCG API
  • Javascript Building Blocks
  • Warenkorb-Komponente

Warenkorb-Komponente

This component shows the cart with the following features:

  • shows cart positions and can render many item and car position attributes
  • offers in-cart manipulation if the amount
  • display items and grouped items (such as boxes and recipe positions TBD)
  • links back to the original items (or grouped items)
  • renders all summary information
  • manipulates action buttons depending on the order state. This includes primary buttons (e.g. the very visible „send“ button) and secondary buttons (such as a smaller „cancel all“ button).
  • allows to add a note about the cart
  • shows a duplicate indicator

One page can have only one cart component.

Example# #

<!DOCTYPE html>
<html>
    <body>
        <h1>Navi Test </h1>      
        <div id="oo-navi"></div> 
        ...
        <div id="oo-cart" data-oo-shop-page="shop.html"></div>
        ...
    </body>
</html>

Attributes# #

oo-shop-page=“<rel-path>“Points to the page within the website, that hosts the main shop component. Clicks will lead to it. If not provided, the current page is not left when clicked.
oo-date-page=“<rel-path>“Points to the page that hosts the date component
oo-logon-page=“<rel-path>“Points to the page that hosts the logon component
oo-thankyou-page=“<rel-path>“optional, points to a thank-you page. Note, this page must host a cart component too! Dont use this if we stay on the same page.
oo-thankyou-new-page=“<rel-path>“optional, points to a thank-you page for new customers
oo-cart-cnote=“false“disables open-on-demand logic for the cart note area, and leaves the field always visible. Note: Its enabled only when the cart is ready to be sent.
oo-profile-page=“<rel-path>“path to the page hosting the profile component
oo-cartmode=“cart“if given and „cart“, the cart is cleared right after submitting and not offered for re-editing. Instead a new order (for the selected day) can be started. May be used independently from oo-cart-oneperday=“false“. Default is „order“ (stay on order, always show order). It makes sense to use a dedicated oo-thankyou-page in this scenario. See also the counterpart on the logon-component. Best set globally !
oo-oneperday=“false“REMOVED! (its an configurable setting in the Backend now) allows multiple orders per tour(== day, default is true, allow only one order per day ). Adds a new option in the cart button area and date selection.
oo-neworderpage=“<rel-path>if oo-oneperday=“false“ is used, this option can be used to change the link to a new order, which is otherwise oo-shop-page.
oo-cart-emptyurl=“<rel-path>if given, the cart will dispatch to this page as soon as it becomes empty (by removing positions or the cart-clear button).
oo-cart-summary: truealways show summary, even as registered user. Otherwise shown only during registration with oo-profile-quickorder:true

External control# #

See API.js.components.status.

Design Hints# #

  • The sample page set has cart.html and cart1.html. The latter has a date component too, so users can change the cart’s date right away.
  • You may assign a separate thank-you page, especially if you use the cart1.html style. Otherwise your thank-you screen is polluted by the date selector

Server Side Template Structure # #

<div class="oo-cart-cart">
    ..regular cart information
    <div>                
        <div class="oo-cart-info-osh">
        ...Information Section        
    </div>

    <table >
        <tbody id="oo-cart-pane">
            <tr id="oo-cart-tpl" class="oo-cart-pos clearfix">
                ...Repeated Cart Positions
        <tbody class="oo-cart-delivercost">
            ..information about Delivery costs
        </tbody>
        <tbody id="oo-cart-vat-pane">
            ...vat information
        <tbody id="oo-cart-sum">
            ..summaries
        </tbody>
    </table>

    <button class="oo-cart-submit" >Checkout</button>
    ...Buttons and Controls

    <div class="oo-cart-info-mbw">
        ...more informational messages

</div>

<div class="oo-cart-empty">
    .section that is displayed if the cart is emptry
</div>

<div class="oo-cart-sent">
    ..section that is displayed once th cart was sent successfully (or not)
</div>

CSS # #

Cart Status

.oo-cart-cartElements shown when cart is in „regular“ state
.oo-cart-sentElements shown when cart is in „sent“ state
.oo-cart-emptyElements shown when cart is in „empty“ state
HTML.oo-cart-state-registerassigned, when the cart is in register mode
HTML.oo-cart-state-sentassigned, when the cart was just sent

Cart Positions

#oo_cart_paneArea that holds all cart item positions. Events (listed below) are triggered onto that element.
#oo-cart-pane > #oo-cart-tplTemplate Fragment which is repeated for each item position
#oo-cart-pane > #oo-cart-tpl imgone image to be loaded with item’s iconic image
#oo-cart-pane > #oo-cart-tpl oo-cart-pos-*Position Values, documented here
.oo-sub-period-<n>assigned to the row, if thats a periodic subscription
#oo-cart-pane TR.oo-sub-mark-duesubscription row, is valid an due
#oo-cart-pane TR.oo-sub-mark-unduesubscription row, is not due
#oo-cart-pane TR .oo-cart-pos-abodatesenabled, if this row is a subscription
#oo-cart-pane TR .oo-cart-pos-abodates .oo-sub-period-<n>notes on this subscription’s details, n is for periodicy

VAT summary

#oo-cart-vat-paneArea that holds all cart vat positions (a list of itemcount vs. vat)
#oo-cart-vat-pane > #oo-cart-vat-tplFragment which is repeated for each vat position
#oo-cart-vat-pane > #oo-cart-vat-tpl .oo-cart-vat-pos-vatvat rate
#oo-cart-vat-pane > #oo-cart-vat-tpl .oo-cart-vat-pos-cntnumber of items for this vat rate
#oo-cart-vat-pane > #oo-cart-vat-tpl .oo-cart-vat-pos-sumtotal vat for this vat rate

Cart Summary

.oo-cart-sumthis element encloses all summary information (enabled/disabled at times)
.oo-cart-sum > .oo-cart-sum-valtotal value of this cart (includes delivery)
.oo-cart-delivercost-noteNote about extra delivery costs
.oo-cart-delivercost-note-valdelivery costs (todo: automatic)
.oo-cart-info-oshinfo about final order closing date time
.oo-cart-info-osh-valthe date time value (todo: automatic)
.oo-cart-info-mbwNote about minimum delivery value
.oo-cart-info-mbw-valthe value itself (todo: automatic)
.oo-cart-info-lateNote about exceeded order stop
.oo-cart-info-late-latestwhen that was (todo: automatic)
.oo-cart-info-late-ddatefor this giove delivery date (todo: automatic)

Action Buttons

.oo-cart-submit-authsubmit button. enabled/disabled at times. Used in case ordering a new Order.
.oo-cart-submit-changesubmit button. enabled/disabled at times. Used in case changing a, existing Order.
.oo-cart-submit-locatedsubmit button. enabled/disabled at times. Used if a visitor in located state goes into the checkout process (registration)
.oo-cart-submit-anonsubmit button. enabled/disabled at times. Used if a visitor in located state goes into the checkout process (date selecton, then registration)
.oo-cart-cancelcancel button. enabled/disabled at times
.oo-cart-cancel-altalternative, not so visible second cancel option (more available than cart-cancel)
.oo-cart-clearclears all items from cart (enabled for new orders)
.oo-cart-revertrevert all changes (enabled for modified orders)
.oo-cart-revert-altrevert all changes (enabled for modified orders, but only when empty as alt to cancel)

Cart Note

.oo-cart-cnoteHolds all elements related to the cart note function

Cart Sent Section

.oo-cart-info-XXElements that are of interest in a thank-you page.
.oo-cart-info-ddateSelected delivery date
Updated on 3. Februar 2025

What are your Feelings

  • Happy
  • Normal
  • Sad
Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest
Table of Contents
  • Example#
  • Attributes#
  • External control#
  • Design Hints#
  • Server Side Template Structure #
  • CSS #
  • Startseite
  • Blog
  • Kontakt
  • Deutsch
    • English
    • Français
    • Español
PCG Team Stolz präsentiert von WordPress