Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Featured Product Image URL to Cart Endpoint #5

Closed
seb86 opened this issue Jan 19, 2018 · 5 comments
Closed

Add Featured Product Image URL to Cart Endpoint #5

seb86 opened this issue Jan 19, 2018 · 5 comments
Labels
needs: help Issues that need help from either another CoCart Core developer or community contributor. type: question The issue is a question about how the product works.

Comments

@seb86
Copy link
Member

seb86 commented Jan 19, 2018

Would it be practical for the featured product image URL to be added to the cart endpoint per product so you would not have to do another request to get it?

This is what the cart endpoint returns currently as default.

Cart endpoint with a product in cart.

The same returns when WC()->cart->get_cart(); is called but if you were to use the cart endpoint to display the products in the cart you don't have the featured product image to display with.

So do think it would be ok to add this variable to each product in the cart or would it cause performance issues?

@seb86 seb86 added needs: help Issues that need help from either another CoCart Core developer or community contributor. type: question The issue is a question about how the product works. labels Jan 19, 2018
@IntelliJAbhishek
Copy link

IntelliJAbhishek commented Feb 8, 2018

Please add featured url . Adding an extra field does not cause performance issue. Every cart show a image o product for that we need do an extra api call which make response time slow. so please add featured_image_url. #Request.
Btw great work cart api is needed feature.

@seb86
Copy link
Member Author

seb86 commented Feb 8, 2018

@IntelliJAbhishek Just the featured image in its full size, thumbnail or all WooCommerce image sizes?

@IntelliJAbhishek
Copy link

@seb86 Just the featured image in its full size thumbnail would be great.

@IntelliJAbhishek
Copy link

IntelliJAbhishek commented Feb 20, 2018

I added this plugin but when I add product I'm Getting Some wornings products adds successful but getting warnings in postman.
I have posted this ..
Method- POST
Endpoint- /cart/add
data- product_id=70 , quantity=2

Response

<br />
<b>Warning</b>:  is_numeric() expects exactly 1 parameter, 3 given in <b>/srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-request.php</b> on line <b>858</b><br />
<br />
<b>Warning</b>:  is_numeric() expects exactly 1 parameter, 3 given in <b>/srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-request.php</b> on line <b>858</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-request.php:858) in <b>/srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1248</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-request.php:858) in <b>/srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api.php</b> on line <b>544</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-request.php:858) in <b>/srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api.php</b> on line <b>545</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-request.php:858) in <b>/srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api.php</b> on line <b>546</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api/class-wp-rest-request.php:858) in <b>/srv/users/serverpilot/apps/wordpress-plugins/public/wp-includes/rest-api.php</b> on line <b>547</b><br />
{"key":"7cbbc409ec990f19c78c75bd1e06f215","product_id":70,"variation_id":0,"variation":[],"quantity":4,"line_tax_data":{"subtotal":{"1":4.3636363636364},"total":{"1":4.3636363636364}},"line_subtotal":43.636363636364,"line_subtotal_tax":4.36,"line_total":43.636363636364,"line_tax":4.36,"data":{}}

@seb86
Copy link
Member Author

seb86 commented Feb 20, 2018

@IntelliJAbhishek Please report issues or bugs related to the ticket. Also, I do not see anything related to those warnings with my API.

@seb86 seb86 closed this as completed Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: help Issues that need help from either another CoCart Core developer or community contributor. type: question The issue is a question about how the product works.
Projects
None yet
Development

No branches or pull requests

2 participants