Skip to content

wikiplugin_bobshop.php (main bobshop function)

romoxi edited this page Sep 25, 2020 · 5 revisions

Basics

(for TikiWiki Plugin Newbies)

This page is about the main bobshop functions.

 `wikiplugin_bobshop_info()`

and

 `wikiplugin_bobshop($data, $params)`

In a TikiWiki-Page a plugin is called by

 `{bobshop type=shop}`

In this example "type" is a parameter which have to defined in the wikiplugin_bobshop_info function.

Wonder what is $data about?

You have to call the plugin this way:

  `{BOBSHOP type=shop}Here comes the body variable{BOBSHOP}`

What happens, whenn you call the plugin in a wkipage?

The function wikiplugin_bobshop($data, $params) will be executet. It should contain vailid PHP-Code.

To use the $params, you have to use extract($params, EXTR_SKIP).

Params used in bobshop

type = show_shop

Print the articles The layout is defined in the template wikiplugin_bobshop_shop.tpl.

type = add_to_cart_button

Print the "add to cart button". The layout is defined in the template wikiplugin_bobshop_button_add.tpl.

type = show_cart

Print the cart. The layout is defined in the template wikiplugin_bobshop_cart.tpl.

type = show_cashier

Print the cahierpage. If there is no user logged in, the Login-Page and a link to the Register-Page will be displayed.

Payment?

The layout is defined in the template wikiplugin_bobshop_cahsierpage.tpl.