Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Extend The Index Of Sravendors Rate Topic   - - - - -

 
  • X-Volution
  • Member
  • Members
  • Join Date: 20-Feb 20
  • 32 posts

Posted 13 March 2020 - 03:36 PM #1

Hi,

 

can you extend the SraVendors, so that we can add additional fields to the Vendor Array.

 

You delete all of the fields, who are not set in $response_fields.

 

Maybe you can create a function with hook, to extend the $response_fields Variable.



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1283 posts

Posted 13 March 2020 - 05:14 PM #2

Hello,

 

What do you mean by "SraVendors"? What is that? Do you want to add more fields to vendor configuration?

 

Best regards,

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • X-Volution
  • Member
  • Members
  • Join Date: 20-Feb 20
  • 32 posts

Posted 14 March 2020 - 01:28 PM #3

This is a Class of storefront_rest_api Addon.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21072 posts

Posted 16 March 2020 - 06:03 AM #4

You should change the following file

 

app/addons/storefront_rest_api/Tygh/Api/Entities/v40/SraVendors.php


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • X-Volution
  • Member
  • Members
  • Join Date: 20-Feb 20
  • 32 posts

Posted 16 March 2020 - 03:35 PM #5

I have it. But I want to have these changes in the next update, so we do not have added our changes after next updates.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11808 posts

Posted 16 March 2020 - 10:33 PM #6

If it's a defect, you can submit it to the bugtracker and in a year or so it MIGHT be added.

If it's your own enhancement you can contact helpdesk and ask them to give you a price for including it in an upcoming release (if they deem it is beneficial for everyone).  Otherwise you'll be left to update it at each release.  Sure you can't use a hook in the functional area of the product to extend the data you want to extend?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21072 posts

Posted 17 March 2020 - 07:16 AM #7

I have it. But I want to have these changes in the next update, so we do not have added our changes after next updates.

 

Unfortunately, this class does not have hooks. But you can extend the API. For example, create v50 directory and your custom SraVendrors class there and use v50 version in API request


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • X-Volution
  • Member
  • Members
  • Join Date: 20-Feb 20
  • 32 posts

Posted 17 March 2020 - 10:17 AM #8

Or CS Cart Devs can add an Hook. That costs maybe 5 seconds of time and can maye help more storeowners than me alone. I think, this is the function of Hooks, to extend the core, without changing original files ;-)



 
  • X-Volution
  • Member
  • Members
  • Join Date: 20-Feb 20
  • 32 posts

Posted 17 March 2020 - 10:28 AM #9

This is my solution for the Moment


This is my solution for the Moment
 

Attached Thumbnails

  • 17032020112720.jpg


 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1283 posts

Posted 17 March 2020 - 10:37 AM #10

Hello

 

After updating the program, your changes may be overwritten. You must remember to check it after each update.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21072 posts

Posted 17 March 2020 - 01:24 PM #11

Or CS Cart Devs can add an Hook. That costs maybe 5 seconds of time and can maye help more storeowners than me alone. I think, this is the function of Hooks, to extend the core, without changing original files ;-)

 

Please make a post here

 

https://forum.cs-car...it-here/page-9?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • X-Volution
  • Member
  • Members
  • Join Date: 20-Feb 20
  • 32 posts

Posted 17 March 2020 - 02:19 PM #12

Done!  8)



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11808 posts

Posted 17 March 2020 - 05:00 PM #13

Why don't you just use the existing 'get_company_data' hook in the function fn_get_company_data() in the file app/functions/fn.companies.php

 

Do you really have a need to go down to the class level?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21072 posts

Posted 18 March 2020 - 05:54 AM #14

Why don't you just use the existing 'get_company_data' hook in the function fn_get_company_data() in the file app/functions/fn.companies.php

 

Do you really have a need to go down to the class level?

 

1. This function is not used in the API

 

2. List of available fields is hardcoded in the class. Other fields are deleted there


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • X-Volution
  • Member
  • Members
  • Join Date: 20-Feb 20
  • 32 posts

Posted 18 March 2020 - 08:16 AM #15

Exacly @eComLabs This is the Problem.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11808 posts

Posted 18 March 2020 - 06:38 PM #16

1. This function is not used in the API

 

2. List of available fields is hardcoded in the class. Other fields are deleted there

 

Well that should be fixed.  Data is data and should be consistent throughout.  The 'orders' API uses fn_get_order_info() which enables one to use a simple hook to adjust data.  In the hook you could even use if( defined("API') ) if need be....  Duplicate engineering.  At a minimum they should use the same hook name so that data from fn_get_company_data() and the class work equivalently.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21072 posts

Posted 19 March 2020 - 08:01 AM #17

Well that should be fixed.  Data is data and should be consistent throughout.  The 'orders' API uses fn_get_order_info() which enables one to use a simple hook to adjust data.  In the hook you could even use if( defined("API') ) if need be....  Duplicate engineering.  At a minimum they should use the same hook name so that data from fn_get_company_data() and the class work equivalently.

 

It uses default fn_get_companies function. As you know, data returned by this function is limited


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11808 posts

Posted 19 March 2020 - 05:43 PM #18

then he can use the 'get_companies' or the 'get_companies_post' hook.  No need to morph a class.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21072 posts

Posted 20 March 2020 - 05:17 AM #19

See point #2 in my post #14


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11808 posts

Posted 20 March 2020 - 06:00 PM #20

See point #2 in my post #14

 

they should get rid of all the hard-coding of fields and either use a schema or hooks to modify them.  Orders suffers from the same.  


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.