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

Bagisto

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

Where did you construct $product array [$product array is available in product detail page]

Knowledge Base
2
4
270
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
    AkashWeybee last edited by 27 Jul 2020, 09:50

    $product array in product detail page

    c9ca9f01-608c-42b5-b358-b231d792d207-image.png

    Basically, I want to add extra fields to this $product array

    product detail page
    cb4aba27-15b8-4db3-9d2e-767d5f594a31-image.png

    1 Reply Last reply Reply Quote 0
    • devansh-webkul
      devansh-webkul last edited by 28 Jul 2020, 07:15

      Hi @AkashWeybee,

      There is an abstract class in file i.e.,

      packages/Webkul/Product/src/Type/AbstractType.php
      

      In that class please check, 'setProduct()' method.

      Please check them. If not then let me know.

      1 Reply Last reply Reply Quote 0
      • A
        AkashWeybee last edited by 29 Jul 2020, 05:41

        @devansh419
        I want to append a few fields to this array.
        So Where do I need to make changes?

        1 Reply Last reply Reply Quote 0
        • devansh-webkul
          devansh-webkul last edited by 29 Jul 2020, 06:49

          Hi @AkashWeybee,

          As I have seen the screenshot, you are trying to access the object.

          There is a 'index()' method in file name i.e. 'packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php'.

          There is a variable '$product' present in the 'if' case, if you want to add custom field than asign property like this,

          $product->extra_field_1 = 'Test 1';
          $product->extra_field_2 = 'Test 2';
          

          And then in the main view access the object like this.

          {{ $product->extra_field_1 }}
          {{ $product->extra_field_2 }}
          
          1 Reply Last reply Reply Quote 1
          3 out of 4
          • First post
            3/4
            Last post