Jump to content

Add to cart missing parameters


Recommended Posts

So I am not new to programming but i am new to Prestashop and PHP. My employer bought a module but it turned out to not be what he was looking for so im building something new, using the old module as a guide. My issue is with the cart, for starters, how does it even work? Documentation for this platform is severely lacking and I admit I am used to more API driven data tasks, where I tell it what to do as opposed to some  magic combination of names.  

Looking at the web requests when adding to the cart from other modules, I can see several parameters being sent (qty,id, etc) however when i click my cart button i still get a 200 but the only parameters being sent are "Action: update" and "Add:1". I tried to model my table/form after the working module but I cant seem to make it work. Below is my html, am i missing something? Or better yet is there a way to bypass this nonsense all together and just build a request and send it manually?

FYI this is running locally, I have cleared the cache, made sure catalog mode is not on, disabled the token requirement, and tried cursing at it loudly, none of it has worked.

{extends file=$layout}
{block name='content'}
    {capture name=path}{l s='Quick Order Form'}{/capture}
    <br/>
    <br/>
    <div class = "quick_order_content table-responsive">
        <table id="quick_order_table_gen" class = "table table-hover table-striped">
            <thead>
            <tr>
                <th class="row_number first_item"></th>
                <th class="ref item">{l s='Reference #'}</th>
                <th class="picture item">{l s='Picture'}</th>
                <th class="name item">{l s='Name'}</th>
                <th class="decli item">{l s='Combination'}</th>
                <th class="quantity item">{l s='Quantity'}</th>
                <th class="price item">{l s='Price'}</th>
            </tr>
            </thead>
            <tbody id = "quick_order_table">
            {for $i = 0 to count($productList)-1}
                <tr class = "item">
                    <td class = "row_number" style="display: none">{$i + 1}</td>
                    <td class = "ref text-center">{$productList[$i]->productRefNum}</td>
                    <td class = "picture">{$productList[$i]->test}</td>
                    <td class = "name">{$productList[$i]->productName}<input type="hidden" class="id_product"/></td>
                    <td class = "decli">{$productList[$i]->productColor}</td>
                    <td class="quantity text-center">
                        <div class="product-quantity clearfix">
                            <div class="qty">
                                <input
                                        type="number"
                                        name="qty"
                                        class="quantity_wanted input-group"
                                        value={$productList[$i]->productQuantity}
                                        min="0"
                                        max="99999"
                                        aria-label="{l s='Quantity' d='Shop.Theme.Actions'}"
                                >
                            </div>
                        </div>
                        <span class="min"></span>
                    </td>
                    <td class = "price">{$productList[$i]->productPrice}</td>
                </tr>
            {/for}
            </tbody>
            <tfoot>
            <tr class="last">
                <td colspan="3" class="text-center">
                    <button id="add_to_cart_fix" class="btn btn-primary" data-button-action="add-to-cart" style="float: right"><i
                                class="material-icons"></i>{l s='Add to cart'}</button>
                </td>
            </tr>
            </tfoot>
        </table>
    </div>
{/block}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...