• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

Get products and redesign the card

General Discussion
3
25
3.7k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    adebayoade last edited by adebayoade 22 Apr 2022, 17:49 22 Apr 2022, 17:45

    How to I get all the products and redesign the product card? The image below is the design I'm trying to match. I have created the a custom page and populated the products but my CSS styles are working on the VUE component.

    Note: The custom page is using my own custom CSS and dependencies.

    @php
    $count = $velocityMetaData ? $velocityMetaData->featured_product_count : 10;
    $direction = core()->getCurrentLocale()->direction == 'rtl' ? 'rtl' : 'ltr';
    @endphp
    
    <div id="featured-products">
        <featured-products></featured-products>
    </div>
    
    
    @push('scripts')
    <script type="text/x-template" id="featured-products-template">
        <div class="featured-products container-fluid font-source_sans">
                <shimmer-component v-if="isLoading && !isMobileView"></shimmer-component>
    
                <template v-else-if="featuredProducts.length > 0">
    
                    @include('components.product-card-header', ["route" => route('shop.home.featured-products'), "title" => "Featured Products"])
    
                    <div
                        id="" class="">
    
                        <div
                            :key="index"
                            v-for="(product, index) in featuredProducts">
                            <div style="border: 2px solid black" class="product-card">
                                <div>
                                    <img width="280" height="280" :src="product.image">
                                    <a :href="`${baseUrl}/${product.slug}`">
                                    <h1>@{{product.name}}</h1>
                                    <div v-html="product.priceHTML"></div>
                                    </a>
                                </div>
                            </div>
                        </div>
    
                    </div>
    
                </template>
    
            </div>
        </script>
    
    <script type="text/javascript">
        (() => {
                Vue.component('featured-products', {
                    'template': '#featured-products-template',
                    data: function () {
                        return {
                            'list': false,
                            'isLoading': true,
                            'featuredProducts': [],
                            'isMobileView': this.$root.isMobile(),
                        }
                    },
    
                    mounted: function () {
                        this.getFeaturedProducts();
                    },
    
                    methods: {
                        'getFeaturedProducts': function () {
                            this.$http.get(`${this.baseUrl}/category-details?category-slug=featured-products&count={{ $count }}`)
                            .then(response => {
                                var count = '{{$count}}';
                                if (response.data.status && count != 0 )
                                {
                                    this.featuredProducts = response.data.products.slice(0, 9);
                                }else{
                                    this.featuredProducts = 0;
                                }
    
                                this.isLoading = false;
                                console.log(this.featuredProducts);
                            })
                            .catch(error => {
                                this.isLoading = false;
                                console.log(this.__('error.something_went_wrong'));
                            })
                        }
                    }
                })
            })()
    </script>
    @endpush
    

    a41b28c8-23c5-4bf9-802e-f1905931e66b-image.png

    1 Reply Last reply Reply Quote 0
    • devansh-webkul
      devansh-webkul last edited by 25 Apr 2022, 12:16

      You can use the published product_card for customization as Laravel will first look into the resources folder.

      A 1 Reply Last reply 28 Apr 2022, 02:27 Reply Quote 0
      • A
        adebayoade @devansh-webkul last edited by adebayoade 28 Apr 2022, 02:34 28 Apr 2022, 02:27

        @devansh-webkul I still can't see my changes. The card I'm editing is at packages\Webkul\Velocity\src\Resources\assets\js\UI\components\ and I ran "npm run dev & npm run watch" but no changes at the front-end. Please guide me further.

        Note: I am working with a new theme which is a copy of all files from Velocity.

        1 Reply Last reply Reply Quote 0
        • devansh-webkul
          devansh-webkul last edited by 28 Apr 2022, 06:17

          Run npm watch from the packages\Webkul\Velocity.

          A 1 Reply Last reply 28 Apr 2022, 11:09 Reply Quote 0
          • A
            adebayoade @devansh-webkul last edited by 28 Apr 2022, 11:09

            @devansh-webkul I already tried that and also "php artisan vendor:publish" but the changes is not reflecting on the front-end.

            1 Reply Last reply Reply Quote 0
            • admin
              admin last edited by 28 Apr 2022, 11:29

              Hi @adebayoade
              Please run npm run watch inside the velocity directory.
              Than run php artisan vendor:publish --force --all

              1 Reply Last reply Reply Quote 0
              • admin
                admin last edited by 28 Apr 2022, 11:30

                @adebayoade
                If still, you are getting the same issue. please let me know.

                A 1 Reply Last reply 28 Apr 2022, 20:08 Reply Quote 0
                • A
                  adebayoade @admin last edited by 28 Apr 2022, 20:08

                  @admin The products are no longer showing after running both commands.
                  ccf6869c-adc6-4107-a810-f9720d7a30a8-image.png

                  1 Reply Last reply Reply Quote 0
                  • admin
                    admin last edited by 29 Apr 2022, 05:07

                    Hi there,
                    Can you please let me know the version of the bagisto which you are using ?

                    A 1 Reply Last reply 29 Apr 2022, 07:06 Reply Quote 0
                    • A
                      adebayoade @admin last edited by adebayoade 29 Apr 2022, 07:24 29 Apr 2022, 07:06

                      @admin version 1.2. Also, the icons are not showing up anymore. 37566989-c0ed-4daa-bea4-aa64afee9268-image.png

                      1 Reply Last reply Reply Quote 0
                      • admin
                        admin last edited by 29 Apr 2022, 07:37

                        @adebayoade said in Get products and redesign the card:

                        1.2. A

                        Hi @adebayoade
                        Please run only npm run watch . after completing your changes. The issue will be resolved.

                        A 1 Reply Last reply 29 Apr 2022, 08:03 Reply Quote 0
                        • A
                          adebayoade @admin last edited by adebayoade 29 Apr 2022, 08:04 29 Apr 2022, 08:03

                          @admin It is not still showing.
                          27ee3e89-2c54-4a75-9232-5ff7ca0c13f5-image.png

                          1 Reply Last reply Reply Quote 0
                          • admin
                            admin last edited by 29 Apr 2022, 08:13

                            @adebayoade said in Get products and redesign the card:

                            is not still showing.

                            Hi There,
                            Please check your webpack file, I guess there is some issue with your webpack file.

                            A 1 Reply Last reply 29 Apr 2022, 08:19 Reply Quote 0
                            • A
                              adebayoade @admin last edited by 29 Apr 2022, 08:19

                              @admin Are you referring to webpack.mix.js?

                              1 Reply Last reply Reply Quote 0
                              • admin
                                admin last edited by 29 Apr 2022, 08:20

                                @adebayoade said in Get products and redesign the card:

                                webpack.mix.js

                                Yes

                                1 Reply Last reply Reply Quote 0
                                • A
                                  adebayoade last edited by 29 Apr 2022, 08:34

                                  @admin This is what it looks like.

                                  let mix = require('laravel-mix');
                                  
                                  /*
                                   |--------------------------------------------------------------------------
                                   | Mix Asset Management
                                   |--------------------------------------------------------------------------
                                   |
                                   | Mix provides a clean, fluent API for defining some Webpack build steps
                                   | for your Laravel application. By default, we are compiling the Sass
                                   | file for the application as well as bundling up all the JS files.
                                   |
                                   */
                                  
                                  mix.js('resources/assets/js/app.js', 'public/js')
                                     .sass('resources/assets/sass/app.scss', 'public/css')
                                      .postCss("resources/assets/css/tailwind.css", "public/css/tailwind", [
                                          require("tailwindcss"),
                                      ]);;
                                  
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • admin
                                    admin last edited by 29 Apr 2022, 09:42

                                    @adebayoade said in Get products and redesign the card:

                                    @admin Are you referring to webpack.mix.js?

                                    @adebayoade
                                    Please take a reference from here, for webpack file.

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      adebayoade last edited by adebayoade 29 Apr 2022, 11:18 29 Apr 2022, 11:08

                                      @admin I've updated the Webpack and checkout to an earlier version of my project. Can you give me steps to follow to create a new product card? Below is the default card. Thank you.

                                      68a09abd-0bc7-4994-b489-a2ac4f1a0d00-image.png

                                      1 Reply Last reply Reply Quote 0
                                      • admin
                                        admin last edited by 29 Apr 2022, 11:54

                                        @adebayoade said in Get products and redesign the card:

                                        Can you give me steps to follow to create a new product card?

                                        Hi @adebayoade
                                        You can change here, for creating custom product card

                                        A 1 Reply Last reply 29 Apr 2022, 14:48 Reply Quote 0
                                        • A
                                          adebayoade @admin last edited by 29 Apr 2022, 14:48

                                          @admin I created a new product card and registered the component in app.js from Velocity dir and then I ran "npm run watch" but my changes are still not showing on the front-end. I am really out of ideas.

                                          1 Reply Last reply Reply Quote 0
                                          4 out of 25
                                          • First post
                                            4/25
                                            Last post