Git Product home page Git Product logo

Comments (4)

iamgergo avatar iamgergo commented on July 17, 2024

Well, you are right, the documentation is not clear about that, I'll update that.

You should define taxes and discounts in a service provider's boot method.

from bazar.

bobitza avatar bobitza commented on July 17, 2024

I did the voucher page in vue and everything work, inclusive update, show, but on the create new page i got errors...
image
The POST method from form go with 0 data inputs values, request payload is empty: []
This is Create.vue:

<template>
    <data-form class="row" :action="action" :data="voucher" #default="form">
        <div class="col-12 col-lg-7 col-xl-8 form__body">
            <card :title="__('General')">
                <data-form-input
                    type="text"
                    name="name"
                    :label="__('Name')"
                    v-model="form.data.name"
                ></data-form-input>
                <data-form-input
                    type="text"
                    name="unit"
                    :label="__('Value (unit-200 or percent-30)')"
                    v-model="form.data.unit"
                ></data-form-input>
                <data-form-input
                    type="number"
                    name="uses"
                    :label="__('Number of uses')"
                    v-model="form.data.uses"
                ></data-form-input>
                <data-form-input
                    handler="editor"
                    name="description"
                    :label="__('Description')"
                    v-model="form.data.description"
                ></data-form-input>
            </card>
        </div>
        <div class="col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar">
            <div class="sticky-helper">
                <card :title="__('Actions')">
                    <div class="form-group d-flex justify-content-between mb-0">
                        <button type="submit" class="btn btn-primary" :disabled="form.busy">
                            {{ __('Save') }}
                        </button>
                    </div>
                </card>
            </div>
        </div>
    </data-form>
</template>

<script>
    export default {
        props: {
            voucher: {
                type: Object,
                required: true,
            },
        },

        mounted() {
            this.$parent.icon = 'coupon';
            this.$parent.title = this.__('Create Voucher');
        },

        computed: {
            action() {
                return '/bazar/vouchers';
            },
        },
    }
</script>

from bazar.

bobitza avatar bobitza commented on July 17, 2024

So the problem was in Database, after i put variable $attributes with default values, only after that work and send the values i typed in inputs to payload

    protected $attributes = [
        'uses'          => 0,
        'code'          => '',
        'value'         => 0,
        'name'          => '',
        'description'   => null,
        'type'          => 'fix'
    ];

from bazar.

bobitza avatar bobitza commented on July 17, 2024

How can i use Discount per all items ? to see price with discount when i have global discount

from bazar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.