Jump to content
thirty bees forum

Madbits

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by Madbits

  1. Mhmm, is that function predefined in JS anywhere? Gonna give it a try right now. YES, YES IT WORKED, YOU DID IT. ❤️ Where can I find some documentation with more functions like that?
  2. I am using attributes as I do not really care about the stock/inventory. Basically we use count to determine the incrementation/decrementation of the list. But if you read the code, it's really easy to figure it out, if count increment -> the selected option in the list is equal to count, eg: count is 2, the second option in the list is selected. Although no matter what you still need a "count" to "save" latest position. Although I have tried to run it without count and I had the exact same results. I will come back with the results in regards to this. Thank you. Good to know.
  3. Link to product with the said feature: Click Here
  4. Do you know what could be the reason of why the options are chosen only "client-side"? When the + button is pressed, the option does change, but when adding the product to the cart, it is added with the "default" option. Eg: Choosing to buy 1.4m of curtain (ignore the dropdown button, I keep it for testing, if choosing our 1.4m by dropdown button, it works perfectly) : now pressing add to cart button, results in: Edit: Just discovered that when increasing product meter by pressing the "+" button and THEN refreshing the page, saves it with the amount chosen via "+" or "-" buttons.
  5. So far I have done the following: Edit product.tpl and implement 2 buttons around our select element as follows: <div id="minusBtn">-</div> <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}"> {$group_attribute|escape:'html':'UTF-8'}</option> {/foreach} </select> <div id="plusBtn">+</div> Then changed their style in product.css so they would look nicer. Then implemented some custom JS into Custom Code as follows: the following JS code: var count = 1 document.getElementById('plusBtn').addEventListener('click', function() { if(count < document.getElementById('group_1').options.length) { count++ document.getElementById('group_1').value = count } else { document.getElementById('group_1').value = 5 } }) document.getElementById('minusBtn').addEventListener('click', function(){ if(count > 1){ count-- document.getElementById('group_1').value = count } else{ document.getElementById('group_1').value = 1 } }) Now issue is that this will use the code on all pages, something which I do not desire, I only want this piece of code on Product.tpl page, although adding it as in <script> tags, crashes the site(error 500). Besides that, the price does not increase as in when chosing the option from the select element like a dropdown( this product has a combination list that impacts the price ) and when adding the product to cart, it does not add the chosen option, but the default one, as if it wasn't even chosen to begin with.
  6. * Bump * So far I have done the following: Edit product.tpl and implement 2 buttons around our select element as follows: <div id="minusBtn">-</div> <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}"> {$group_attribute|escape:'html':'UTF-8'}</option> {/foreach} </select> <div id="plusBtn">+</div> Then changed their style in product.css so they would look nicer. Then implemented some custom JS into Custom Code as follows: the following JS code: var count = 1 document.getElementById('plusBtn').addEventListener('click', function() { if(count < document.getElementById('group_1').options.length) { count++ document.getElementById('group_1').value = count } else { document.getElementById('group_1').value = 5 } }) document.getElementById('minusBtn').addEventListener('click', function(){ if(count > 1){ count-- document.getElementById('group_1').value = count } else{ document.getElementById('group_1').value = 1 } }) Now issue is that this will use the code on all pages, something which I do not desire, I only want this piece of code on Product.tpl page, although adding it as in <script> tags, crashes the site(error 500). Besides that, the price does not increase as in when chosing the option from the select element like a dropdown( this product has a combination list that impacts the price ) and when adding the product to cart, it does not add the chosen option, but the default one, as if it wasn't even chosen to begin with.
  7. Nobody will probably ever find that out.
  8. On the left side there should be the blocks with options to choose from in order to filter/sort the products, like tags or price. For some reason it disappeared this morning when I checked my website. Also my slider suddenly vanished as well, it was hooked to "header" but couldn't see it so I tried to hook it to any other hook available and it never worked or looked as it should, each photo was stacking upon each other. The slider should have been in its position between menu & products.
  9. Basically at the moment, from what I can see while looking into product.tpl, I will need to implement at a core level a new group_type into $group, currently looking where $group is defined as I have never worked with smarty before. Front-End wouldn't be an issue, the buttons themselves.
  10. That would be a solution too, although I am working for a client and just decided to switch over to thirtybees from woocommerce, I would gladly implement the feature myself through PHP, I just have a hard time figuring out the structure of the framework at the moment, if there would be a free module than it would be even better. What I have explained can be easily achieved through woocommerce, didn't expect such product attributes to not be available on prestashop/thirtybees.
  11. Oh, indeed, easily done. Any idea if I can replace the dropdown with an incrementing/decrementing button? I should be able to sell between 1 and 20 linear meters, isn't there a method to just limit an incrementing button to 20 or something instead of creating values like: 1m, 1.1m, 1.2m, 1.3m, 1.4m so on and so forth until 20m, which would take quite a lot of time.
  12. Hi there, I need a solution to be able to sell products per linear meter, of course when increasing the length in meters the price should increase as well. I am willing to try and implement it myself as a module if needed, I just need a little bit of guidance as in where I should look into as a first step to get started. Is there any free module already doing this? Cheers.
×
×
  • Create New...