Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kberov/slovo-plugin-prodan

Slovo::Plugin::Prodan – Make and manage sales in your Слово-based site
https://github.com/kberov/slovo-plugin-prodan

delivery econt invoice-pdf mojolicious perl products sales shopping-cart slovo

Last synced: 5 days ago
JSON representation

Slovo::Plugin::Prodan – Make and manage sales in your Слово-based site

Awesome Lists containing this project

README

        

=encoding utf8

=head1 NAME

Slovo::Plugin::Prodan - Make and manage sales in your Slovo-based site

=head1 SYNOPSIS

# In slovo.conf
load_plugins => [
#...
'Themes::Malka',
{
Prodan => {
migrate => 1,
consents => {
gdpr_url => '/ѿносно/условия.bg.html',
phone_url => $ENV{SLOVO_PRODAN_PHONE_URL},
delivery_prices_url => '/ѿносно/цени-доставки.bg.html',
},
econt => {
shop_id => $ENV{SLOVO_PRODAN_SHOP_ID},
private_key => $ENV{SLOVO_PRODAN_PRIVATE_KEY},
shippment_calc_url => 'https://delivery.econt.com/customer_info.php',
crupdate_order_endpoint =>
'https://delivery.econt.com/services/OrdersService.updateOrder.json',
create_awb_endpoint =>
'https://delivery.econt.com/services/OrdersService.createAWB.json'
}}
},
#...
],

=head1 DESCRIPTION

The word про̀дан (прода̀жба) in Bulgarian means sale. Roots are found in Old
Common Slavic (Old Bulgarian) I<проданьѥ>. Here is an exerpt from Codex
Suprasliensis(331.27) where this word was witnessed: I<сꙑнъ божии. вол҄еѭ
на сьпасьнѫѭ страсть съ вами придетъ. и на B<продании> станетъ.
искѹпѹѭштааго животворьноѭ кръвьѭ. своеѭ миръ.>

L is a L that extends a
Slovo-based site and turns it into an online shop.

=head1 FEATURES

In this edition of L we implement the following features:

=head2 A Shopping cart

A jQuery and localStorage based shopping cart. Two static files contain
the implementation and they can be inflated. The files are
C and C. You should inflate these files into
your public forlder C for the domain on which you
will use it. Even not inflated these will be referred from any page of the
site. The site layout C includes automatically these
two static files if this plugin is loaded.

# Inflate new static files from Slovo::Plugin::Prodan
bin/slovo inflate --class Slovo::Plugin::Prodan -p --path domove/xn--b1arjbl.xn--90ae/public

To add a product to your cart and make an order, you need a button, containing
the product data. For example:


See "A template..." below.

=head2 Delivery of sold goods

A "Pay on delivery" integration with Bulgarian currier L.

=head2 Products

Products - a products SQL table to populate your pages with products. You
create a page with several articles (celini) in it. These celini will be the
web-pages for the products. You prepare a YAML file with products. Each product
C property must match exactly the celina C and C on
wich this product will be placed. See C and
C for examples. See L
on how to add and update products.

=head2 Products template for books

A template for displaying products within a C. You can modify this
template as you wish to display other types of products - not just books as it
is now. See C inlined in this file's C<__DATA__>
section. It of course can be inflated using
L. The template produces the HTML from the
products table, including the button mentioned above already.

# Add the template form Prodan
bin/slovo inflate --class Slovo::Plugin::Prodan \
-t --path domove/xn--b1arjbl.xn--90ae/templates/themes/malka

=head2 Consents

A section in the Prodan configuration for different settings - only urls for
now. C<$app-Econfig('consents')> may contain any settings needed for the
client side of the plugin not related dierctly to integration with deliverers
or payment providers.

=head3 GDPR and Cookies consent

A GDPR and cookies consent alert in the footer which upon click leads to the
page (celina) where all conditions on using the site can be described. When the
user clicks on the link to the I page a flag in C is put
so the alert is not shown any more. This flag disappears if the user clears any
site data and the alert will appear again if the user vists the site again.
The Consent celina is created automatically in the localhost domain as an
example. Search for C in the source of this module to see how it
is implemented.

Settings:

Keys Default Values
--------------------------------------------
gdpr_url '/ѿносно/условия.bg.html'
ihost punycode_decode(ed) current host

=head3 Delivery prices URL

This is just a setting for this plugin - C. Defaults to
'/ѿносно/цени-доставка.bg.html'. This is a place where the prices for delivery
are described. The link is displayed at the bottom of the shopping cart widget.
It is created automatically for localhost as the C

=head3 phone_url

Currently displayed as a link in the _footer_right.html.ep template.

=head2 TODO some day

=over 1

=item Invoices - generate an invoice in PDF via headless LibreOffice instance
on your server.

=item Merchants - a merchants SQL table with Open API to manage and
automatically populate invoices.

=item Other "Pay on Delivery" providers. Feel free to contibute yours.

=item Other types of Payments and/or Online Payment Providers like online POS
Terminals etc.

=back

=head1 METHODS

The usual method is implemented.

=head2 register

Prepends the class to renderer and static classes. Adds some REST API routes,
configures the deliverer.

=head1 EMBEDDED FILES

@@ css/cart.css
@@ js/cart.js
@@ img/arrow-collapse-all.svg
@@ img/cart-arrow-right.svg
@@ img/cart.svg
@@ img/cart-check.svg
@@ img/cart-off.svg
@@ img/cart-minus.svg
@@ img/cart-plus-white.svg
@@ img/cart-plus.svg
@@ img/cart-remove.svg
@@ img/econt.svg
@@ partials/_footer_right.html.ep
@@ partials/_consents.html.ep
@@ partials/_kniga.html.ep
@@ resources/data/prodan_migrations.sql

=head1 SEE ALSO

L,
L,
L,
L,
L,
L,
L

=head1 AUTHOR

Красимир Беров
CPAN ID: BEROV
berov на cpan точка org
http://слово.бг

=head1 CONTRIBUTORS

Ordered by time of first commit.

=over

=item * Your Name

=item * Someone Else

=item * Another Contributor

=back

=head1 COPYRIGHT

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

The full text of the license can be found in the
LICENSE file included with this module.

This distribution contains icons from L and
may contain other free software which belongs to their respective authors.