texts:
I uploaded image file name called !!!.png it stored in Database but in Media it stored file.png i don't know what is the problem

public function fanbookAction(){
        $img = ''.$this->getRequest()->getPost('img');
                if(isset($_FILES['img']['name']))
                {
                    try{
                        $uploader = new Varien_File_Uploader('img');
                        $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); // Your Format Here
                        $uploader->setAllowRenameFiles(true);
                        $uploader->setFilesDispersion(false);
                        $path = Mage::getBaseDir('media').DS.'FanBook'.DS;
                        $destFile = $path.'/'.str_replace(' ','_',$_FILES['img']['name']);
                        $filename = $uploader->getNewFileName($destFile);
                        $uploader->save($path, $filename);
                        $img ='FanBook/'.$filename;
                        $collection = Mage::getModel('fanbook/fanbook');
                        $collection ->setData('img',$img);
                        $collection->save();

                        $this->_redirectReferer();
                        Mage::getSingleton('core/session')->addSuccess('Your Request has been Completed Successfully');
                    }

                    catch(Exception $e) {

                         $this->_redirectReferer();
                        Mage::getSingleton('core/session')->addSuccess('Upload Error');

                    }

                }
    }

Updated

try{
                        $uploader = new Varien_File_Uploader('img');
                        $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); // Your Format Here
                        $uploader->setAllowRenameFiles(true);
                        $uploader->setFilesDispersion(false);
                        $path = Mage::getBaseDir('media').DS.'FanBook'.DS;
                        $destFile = $path.'/'.str_replace(' ','_',$_FILES['img']['name']);
                        //$filename = $uploader->getNewFileName($destFile);
                        $fileName = preg_replace('/[^a-z0-9_\\-\\.]+/i', '_', $fileName);
                        if (preg_match('/^_+$/', $fileInfo['filename'])) {
    $fileName = 'file.' . $fileInfo['extension'];
}

                        $uploader->save($path, $filename);
                        $img ='FanBook/'.$filename;
                        $collection = Mage::getModel('fanbook/fanbook');
                        $collection ->setData('img',$img);
                        $collection->save();

                        $this->_redirectReferer();
                        Mage::getSingleton('core/session')->addSuccess('Your Request has been Completed Successfully');
                    }


texts: Add Custom Link Under Existing Categories

texts:
I would like to add some links under a specific categories, not subcategories !

Normally you would create a subcategory under a category and so on but, I need to add some filter link which in turn it will look like it's subcategory.E.G

TEST-CATEGORY is a Category created from admin backend but MY CUSTOM LINK 1 and MY CUSTOM LINK 2 are not

Anyone have any Idea how to intercept that an append some link to it ?

Appreciate!


texts: sales_order_shipment_track_save_after get order ID

texts:
I want to integrate sms trigger on sales_order_shipment_track_save_after event. I have created a custom module and the trigger is being called but I am not able to get orderid from shipment. Following is the code from my observer.

$shipment = $observer->getEvent()->getShipment();
        $order = $shipment->getOrder();
        $orderId = $order->getIncrementId();

but I keep on getting

  Fatal error: Call to a member function getOrder() on a non-object in C:\xampp\htdocs\company\app\code\local\Company\Smstrigger\Model\Observer.php on line 11

can someone please point me to correct code for the same.

Magento version 1.9


texts: M2 : After magento upgrade not able to save "state" form address edit page

texts:
I have upgrade magento version after that i'm not able to save state (region), from both admin and frontend side into address edit section.

I have check customer's attributes and address attributes from admin and also try with apply reindex, deploy and other command.

I have also remove custom plugins, but still not able to save state (region).

When i select country like "Uganda" after that state dropdown replace with textbox and that textbox value can be saved but like "United states" country having dropdown so that dropdown value not able to save.

i have check state dropdown, there isn't any issue with state dropdown html code.


texts: Is there a way to select how many products there should be shown in a grid by default?

texts:
By default my list of products (grid) shows 9 products, by it is able to be changed to 15 or 30.

Is there a way in which I can choose to display 30 products by default, when someone loads the site?

Here is a picture of the selection: https://imgur.com/a/fqdvS

Thanks.


texts:
I need to create 2 widgets on the homepage (CMS Home Page -> Main Content Area).

In order to do that, I created 2 modules (one for each widget) and extended from Catalog Product List to use my own template (and also to select the products from the admin in a more fancy way).

The problem is that the frontend is displaying the same widget twice (the first one, the other one doesn't appear at all).

Apparently there is a known issue related to this, but if someone found a solution to this bug and share it, it would be greatly appreciated.


texts: Is it ever ok to use "echo" in controllers? What's the Magento way?

texts:
A lot of Magento tutorials are using echo to output controller text.
However, using echo can cause weird problems, like the infamous “Headers already sent” error.

I understand that the right way to return response is by using setBody(), eg $this->getResponse()->setBody($text);, but for some cases I prefer using echo for convenience (returning by parts vs returning all at once).

So my question is - is there a "safe" Magento way to use echo in controllers? or is it a big no-no and should never be used?

PS I can use collect data myself and just call setBody() at the end (eg do something like "$ret .= ..." instead of echo), but in this case an uncaught error will not give me any output, while using echo will at least show me some of the output, up until the error. I'm talking about debug pages here so partial is still very useful :)


texts:
Magento2 getting error when I search for digits 1 & 2
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 3, query was: SELECT `e`.*, IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) AS `is_active` FROM `catalog_category_entity` AS `e`
 INNER JOIN `catalog_category_entity_int` AS `at_is_active_default` ON (`at_is_active_default`.`entity_id` = `e`.`entity_id`) AND (`at_is_active_default`.`attribute_id` = '46') AND `at_is_active_default`.`store_id` = 0
 LEFT JOIN `catalog_category_entity_int` AS `at_is_active` ON (`at_is_active`.`entity_id` = `e`.`entity_id`) AND (`at_is_active`.`attribute_id` = '46') AND (`at_is_active`.`store_id` = 1) WHERE (IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) = '1') AND (())
Exception #1 (PDOException): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 3

How to debug this?


texts: How can I enable the WYSIWYG editor to be on by default for just one module?

texts:
I don't use the WySiWyG editor because it removes the formatting in CMS blocks and get to mangle {{ }} directives with image tags.

However my colleagues use a helpdesk module that is a paid for 'AheadWorks' module. They need the WySiWyG editor on by default.

The 'problem' is that they need the editor enabled by default whereas I need it disabled by default.

Is there any way of solving this in an easy way without having to learn another area of Magento code?


texts: Magento 2.1, Sanitization scripts for dev environment?

texts:
I was wondering if anybody has developed a SQL Sanitization script for Magento 2.1 for test/dev environment?

To clarify, We make a copy of our production environment into a development environment periodically, and it would be useful/helpful (and safer) to have all clients/orders/invoices Sanitized of any personally identifiable information (names, address, email address), without deleting those customers/orders/invoices etc.

Any suggestions/sample queries/recommendations are welcome.


texts: Magento 2 - Change top navigation submenu position

texts:
I create a new theme for Magento 2 based on Luma theme. I change the submenu of the top navigation to be 100% width.

.navigation .level0 .submenu {
    max-width: 1280px;
    width: 1280px;
    padding: 25px 0;
}

And now I want to change the submenu position, right now the submenu start right selected category, I need to made the submenu to start from left side.

I try to add position: absolute; and left: 0; but is not working.

How I can move this submenu to start from left side?

Thank you


texts: 1.9.3.10 Google Chrome Security Update make payment redirect page error

texts:
I am using Magento 1.9.3.10, after successful payment page redirect to https://mysite.in/checkout/cart/  with empty cart and customer is logged out
Error :
After successful payment return Shopping Cart is Empty message instead of the success page.
Note: Is it recommended to set Google cookie SameSite to temporarily solve this issue?
How to solve this issue? Get & Post method error.


texts: Quantity Change Event is inventory killer

texts: Such unattended automatic quantity change events are a big hit on the SB inventories. Say you have handles 1,000 e. and your magento is synced to Quick Books for daily sales reporting. Magento frequently (and for unknown reasons) tend to increase or decrease the qty of "some" items. Our off-shore developers wasn't able to fix this, let along understand the possible coding mistakes that cause the problem. Any ideas are more than welcomed.


texts: magento 1.9 different shipping price for each state / province

texts: I have magento 1.9.3.8 and i want to set a different shipping price for each state/province i tried to configure it from dashboard but i couldn't ,  any solution for this ?


texts: How to extend js class/method of checkout model class in magento 2

texts:
Basically I need to some method overwrite/extend of following Js class.

magento/module-checkout/view/frontend/web/js/model/step-navigator.js

Overwrite of this class through requirejs working fine. But I need to extend one of method of this class. here is an example of overwrite requirejs-config.js

var config = {
    "map": {
        "*": {
            "Magento_Checkout/js/model/step-navigator": "SR_Checkout/js/model/step-navigator"
        }
    }
};

How to extend some method of any model class in checkout.


texts: backend design gets collapsed when changed to client side compilation mode

texts:
After magento 2 installation, when I change to client side compilation mode and save the config the backend design gets collapsed like below,

What should be done to resolve this issue?


texts: How to override core helper in magento 2?

texts:
I writed a preference for class Magento\Catalog\Helper\Image but i got this error:

  Recoverable Error: Argument 4 passed to
  Magento\Checkout\Block\Cart\Sidebar\Interceptor::__construct() must be
  an Instance of Magento\Catalog\Helper\Image, instance of
  RMI\ImageCDN\Helper\Image given, called in
  C:\xampp\htdocs\magento\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php
  on line 107 and defined in
  C:\xampp\htdocs\magento\var\generation\Magento\Checkout\Block\Cart\Sidebar\Interceptor.php
  on line 11

If preference is not a good way to override a helper in core , what is the solution?


texts: Is It possible if I will not add product in Magento2 database?

texts: Is It possible if I will not add product in Magento2 database , or maybe add product ID attribute for identify the existence in Magento2 system only but I will call API to get product from third party app. and It still can use Magento2 default module such as add to cart or checkout?


texts:
After trying a lot of extensions, I've ended up uninstalling all the extensions and add the social buttons by myself via code.
Apparently I managed to create the buttons correctly (altough the Facebook button takes a HUGE amount of sec. to load) but I'm struggling to have these buttons automatically trnaslated in other language.
My website has 2 languages (and store views), but I can not find how to swap the button text and the social popup content for sharing automatically.
So, now the trouble is:
I have the FB "like" button in Italian, when I change store view for English I still have the FB "like" button (and the content of the FB box for sharing the product) in Italian.
Is it possible to change this?
This is the code inside the file "view.phtml":

<fb:like ref="product_page" layout="button_count" show_faces="false" colorscheme="light" width="500"></fb:like>

I tried to replace
<?php echo $this->__('it_IT') ?>

with :
<?php echo $this->getLang() ?>

But the fb button disappears.


texts: Product page not loading  after Magento 2.3.2 update

texts:
I have recently updated from Magento 2.3.0 to Magento 2.3.2 and everything seems to be ok, apart from the product page (and example is here: https://staging.propmasters.net/james-bond-octopussyrupee-bank-note )

It just loads with the gallery spinner showing and looking at the html there doesn't appear to be anything loading in the

I've connected to the site via SSH and ran:

bin/magento cache:flush
bin/magento setup:static-content:deploy
bin/magento indexer:reindex

But it's still showing the same. I can't work out why it's doing it


texts:
When I go to the Checkout on 2 different devices, I get different console errors.

On a DELL laptop I get the error on domain.com/checkout:

$.widget is not a function (dataPost.min.js)
Cannot read property of 'timepicker' of undefined

On an ASUS laptop I only get the following error in on domain.com/checkout:

Cannot read property of 'timepicker' of undefined

I use the same browser on both laptops. On the DELL laptop the checkout keeps showing the loading icon without any change. On the ASUS laptop the checkout works fine.

I use chrome 60 on both laptops.

I already tried merging, minifying and bundling javascript files.


texts: How can I read my extension's version in Magento 2?

texts:
In Magento 1.x I was able to read my module's version like so:

(string)Mage::getConfig()->getNode('modules/MyModuleName/version');

I'm unable to figure out how I can do the same in Magento 2.0. Thanks.


texts:
When I open the category page on the admin and when I try to edit category I got the below error:

  Fatal error: Method
  Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an
  exception, caught Error: Cannot use string offset as an array in
  /vendor/magento/module-ui/Component/Wrapper/UiComponent.php on line 0

Do you have any idea how we can solve it!

Your answers are appreciated

Thanks!


texts: rest API - send product translations for store-view

texts:
We've setup in Magento a website with multiple store-views for translations.
The products and translations are stored in Microsoft Navision and will be transfered to Magento by using the rest API.
We're looking for an approach to send the translations (like different product names for the SKUs) from Navision to Magento by using some store-view identifier.
Is this approach working in Magento:
POST or PUT /rest/<store_code>/V1/products
default store:     /rest/default/V1/products/sku
german store-view: /rest/german/V1/products/sku
english store-view: /rest/english/V1/products/sku
Thx for help.
Regards Georg


texts:
My goal is to have a cart that live updates when you change the quantity's. Normally you need to press the 'update cart' button.

So I update my cart live by doing this:

require(['jquery', 'Magento_Customer/js/customer-data',
    'jquery/jquery-storageapi'], function ($) {
    // $("#submitbutton").hide();
    var form = $('form#form-validate');
    var qtyfields = $('input.qty');
    var increase = $('.meigee-arrow-right');
    var decrease = $('.meigee-arrow-left');
    increase.remove();
    decrease.remove();

    form.find(qtyfields).each(function (e) {

        $(this).change(function () {

            console.log('change detected');
            var thisfield = $(this);
            var datafield = thisfield.val();
            thisfield.attr('defaultValue', 'value');
            thisfield.html(datafield);
            TriggerAjax();

        });
    });

    function TriggerAjax() {
        $.ajax({
            url: form.attr('action'),
            data: form.serialize(),
            type: 'post',
            success: function (res) {
                form.submit();
                console.log('succes');
            },
            error: function () {
                console.log('error');
            }
        });
    }

    form.on('submit', function (e) {
        console.log('form submitted');
        e.preventDefault();
    });

    function LiveError() {
        console.log('test live error');
    }
});

And this works fine. I see the numbers change in my cart when the stock is there. The only thing is that the error message is not visible until I reload my cart page (the checkout/cart page).

Now i noticed that the form has data-mage-init='{"validation":{}}'

<form action="<?php /* @escapeNotVerified */ echo $block->getUrl('checkout/cart/updatePost') ?>"
          method="post"
          id="form-validate"
          data-mage-init='{"validation":{}}'
          class="form form-cart">

When I look closer at that Magento widget it does some kind of validation and sends it through ajax (i guess).

What I'm thinking is that it's not getting trigger until the page is reloaded so I'm not sure how to initiate this or make this happen.

Thanks in advance!


texts: Magento 2 Runtime Error After Migration to production server

texts:
I have been developing using Magento for years and finally jumped into Magento 2.

Everything is setup and running locally well but I've moved the code base to a production server and getting the following error:

Next RuntimeException: Source class \Magento\Store\Model\Config\Reader\ReaderPool for

Magento\Store\Model\Config\Reader\ReaderPool\Proxy generation does not exist. in /var/www/html/cwu/vendor/magento/framework/Code/Generator.php:185

There is a big stacktrace that follows this but no mention of other errors.

Anyone seen this before?


texts: set discount amount while creating order progrmmatically in magento2

texts:
I am creating order pro-grammatically.

I have referred below code

https://www.rakeshjesadiya.com/how-to-create-order-programmatically-in-magento-2/

My requirement is to set discount amount for each cart item.

The discount amount is 5. This can be varied based the product id which i am fetching from external api

I tried below code for that.

 $quote->setDiscountAmount(5);

after the line

$quote->addProduct($product,$buyRequest);

It is not working. Can anyone help me to achieve this functionality.

Thanks for your help

Update

As from Amit suggestion i used below code.

Vendor\Module\etc\sales.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd">
<section name="quote">
    <group name="totals">
        <item name="testdiscount" instance="Vendor\Module\Model\Quote\Discount" sort_order="500"/>
    </group>
</section>

Vendor\Module\Model\Quote\Discount.php

namespace X247commerce\CustomerService\Model\Quote;

 class Discount extends
 \Magento\Quote\Model\Quote\Address\Total\AbstractTotal
 {
 protected $_priceCurrency;

  public function __construct(
   \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  ){
   $this->_priceCurrency = $priceCurrency;
  }

public function collect(
   \Magento\Quote\Model\Quote $quote,
   \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment,
   \Magento\Quote\Model\Quote\Address\Total $total
 )
{
   parent::collect($quote, $shippingAssignment, $total);
       $baseDiscount = 10;
       $discount =  $this->_priceCurrency->convert($baseDiscount);
       $total->addTotalAmount('customdiscount', -$discount);
       $total->addBaseTotalAmount('customdiscount', -$baseDiscount);
       $total->setBaseGrandTotal($total->getBaseGrandTotal() - $baseDiscount);
       $quote->setCustomDiscount(-$discount);
       $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
       $objectManager->get('Psr\Log\LoggerInterface')->info('discount'.$discount);
      $objectManager->get('Psr\Log\LoggerInterface')->info(json_encode($quote->getData()));
   return $this;
  }

}


texts:
How can I remove product from cart REST API. I searched on

http://devdocs.magento.com/guides/v2.0/rest/list.html

and could not find any help from above reference.


texts:
I created 2 new attribute and I want to use them to calculate price. I use this code but I don't know how to get the value of these attribute. Any ideas on the best way to do this? Thanks so much!

<?php
class GoIvvy_PriceFormula_Model_Observer
{
   public function calculateFinalPrice($observer)
   {
        $_product = $observer->getEvent()->getProduct();
        // $mount = ???
        // $per = ???
        $finalPrice = (100+$mount)*$per;
        $_product->setFinalPrice($finalPrice);
        return $this;
   }
   public function collectionFinalPrice($observer)
   {
       $collection = $observer->getEvent()->getCollection();
       foreach($collection as $_product){
        // $mount = ???
        // $per = ???
        $finalPrice = (100+$mount)*$per;
        $_product->setMinimalPrice($finalPrice)
                  ->setPrice($finalPrice)
                  ->setFinalPrice($finalPrice);
       }
     return $this;
   }
}


texts: Magento 2: I want set a custom param to checkout session via API Rest

texts:
Eu criei um atributo de extensão  chamado "device"
para o order, agora quero setar esse atributo na sessão do checkout atraves de uma requisão API.
Assim setar esse parametro no fechamento o pedido.


texts: Execute Custom Index before Magento Indexes - Re-order Indexing

texts:
I have created a custom module which contains indexing logic. The indexing is working and my data is being indexed.

But the problem is that my custom indexes always executes after Magento's default indexes have finished execution. I want to run my index before Magento's default indexes.

I have checked default Magento's indexes and found that there is no sort_order attribute or anything like that for indexes in its configuration files. I have also found that the indexes are not being executed in the order it is stored in database table.

I think it is executed based on module execution/load. Is there any way I can re-order indexes to execute my indexes first and then default Magento's indexes.


texts: How to list products on home page in magento 2?

texts: I want to filter the products with custom attribute and display the result on homepage, i need to do it pragmatically? Is that possible ? If yes please explain


texts: how to override private function in sales module

texts:
I am trying to override this following function.

    /**
 * Extract the form values from attributes.
 *
 * @param array $attributes
 * @param int $storeId
 * @return array
 */
private function extractValuesFromAttributes(array $attributes, int $storeId): array
{
    $formValues = $this->getFormValues();
    foreach ($attributes as $code => $attribute) {
        $defaultValue = $attribute->getDefaultValue();
        if (isset($defaultValue) && !isset($formValues[$code])) {
            $formValues[$code] = $defaultValue;
        }
        if ($code === 'group_id' && empty($defaultValue)) {
            $formValues[$code] = $this->getDefaultCustomerGroup($storeId);
        }
    }

    return $formValues;
}

This is the core file Magento\Sales\Block\Adminhtml\Order\Create\Form\Account.php

Any Help or tips
I tried preference but didn't work for me.


texts: Index Times takes so long in magento 2.3.2?

texts:
Hello I would like to ask a few things about Indexing.
I am using Magento 2.3.2 and i am building a website in localhost. Until now i have imported 45.000 products.
I runned index and it took about 9 hours for 45.000 products! please see bellow times.

    info@LAPTOP-5SEJ1RGM c:\xampp\htdocs\gigaparts'

    php bin/magento indexer:reindex

    Design Config Grid index has been rebuilt successfully in 00:00:00
    Customer Grid index has been rebuilt successfully in 00:00:00
    Category Products index has been rebuilt successfully in 05:12:13
    Product Categories index has been rebuilt successfully in 00:00:00
    Catalog Rule Product index has been rebuilt successfully in 00:00:00
    Product EAV index has been rebuilt successfully in 00:00:29
    Stock index has been rebuilt successfully in 00:00:11
    Inventory index has been rebuilt successfully in 00:00:00
    Catalog Product Rule index has been rebuilt successfully in 00:00:00
    Product Price index has been rebuilt successfully in 00:03:55
    Catalog Search index has been rebuilt successfully in 03:25:39

What if i reach 500.000 or 700.000 references? how long it will need?
Also lets say i am at 700.000 and i add one more reference. (I will import new references through ERP system linked to magento).
How long will it need to appear to my site?
Are these times normal? Or there is a bug?
Should i try different magento version?
Please advise.


texts: Error installing security patches on CE 1.7.0.2

texts:
SUPEE-1533 installed with no problem. Then attempted to install SUPEE-5345 and three files were patched successfully but the 4th file failed:

  # sh PATCH_SUPEE-5345_CE_1.7.0.2_v1-2015-02-10-08-11-22.sh
  Checking if patch can be applied/reverted successfully...
  ERROR: Patch can't be applied/reverted successfully.

  patching file app/code/core/Mage/Admin/Model/Observer.php
  patching file app/code/core/Mage/Core/Controller/Request/Http.php
  patching file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
  patching file lib/Varien/Db/Adapter/Pdo/Mysql.php
  Hunk #1 FAILED at 2672.
  1 out of 1 hunk FAILED -- saving rejects to file lib/Varien/Db/Adapter/Pdo/Mysql.php.rej

FYI, the MySQL.php.rej file that the patch supposedly created it not there.

Is there anything I need to do to get that last file patched, or is it something I don't need to worry about?


texts: How to overwrite UI Component XHTML files in a theme - Recently Viewed

texts:
How can I override vendor/magento/module-ui/view/base/ui_component/templates/listing/default.xhtml in a theme? In this instance it's for the recently viewed products widget.

This is added here - vendor/magento/module-ui/view/base/ui_component/etc/definition.xml:10

<listing sorting="true" class="Magento\Ui\Component\Listing" component="uiComponent">
    <argument name="data" xsi:type="array">
        <item name="template" xsi:type="string">templates/listing/default</item>
        <item name="save_parameters_in_session" xsi:type="string">1</item>
        <item name="client_root" xsi:type="string">mui/index/render</item>
    </argument>
</listing>


texts: Magento reindexing keeps generating .lock files

texts:
In the Magento backend all reindexing processes are done -> status ready. Green buttons for all the indexes.

In the FTP when I delete the lock files in the directory var/locks/ they are deleted and re-created instantly. And the last edited time of the .lock files changes every second. While there is no index process running when I check it in the backend. So I delete .lock file and in 1 second it re-appears.

I have tried deleting the complete var/locks folder but when I recreate it the lock files appear instantly. Also I tried restarting apache. I tried renaming indexer.php but even then the lock files were re-created again.

What can I do?


texts: Extending magento sales order controller not working

texts:
I'm trying to extend the mage order controller, but i'm getting a 404 error. As far as i can tell my custom ordercontroller is not being included. I've read multiple Q&A's on stackexchange but i can't find anything out of the ordinary in my code.

Below is how my module is build up:

app/etc/modules/Bromo_Orderstatus.xml

<?xml version="1.0" ?>
<config>
    <modules>
        <Bromo_Orderstatus>
            <active>true</active>
            <codePool>local</codePool>
        </Bromo_Orderstatus>
    </modules>
</config>

app/code/local/Bromo/Orderstatus/etc/config.xml

<config>
    <modules>
        <Bromo_Orderstatus>
            <version>1.0.0</version>
        </Bromo_Orderstatus>
    </modules>
    <global>
        <blocks>
             <adminhtml>
                <rewrite>
                    <sales_order_view>Bromo_Orderstatus_Block_Adminhtml_Sales_Order_View</sales_order_view>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <use>admin</use>
                <args>
                    <modules>
                        <orderstatus before="Mage_Adminhtml_Sales">Bromo_Orderstatus_Adminhtml</orderstatus>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

app/code/local/Bromo/Orderstatus/Block/Adminhtml/Sales/Order/View.php

<?php
class Bromo_Orderstatus_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
    public function  __construct() {
        $message = Mage::helper('sales')->__('Weet je zeker dat je de klant een klaar voor afhalen e-mail wil versturen?');
        $this->_addButton('afhalenmail', array(
            'label'     => Mage::helper('Sales')->__('Stuur afhaal E-mail (nog niet gebruiken!)'),
            'onclick'   => "confirmSetLocation('{$message}', '{$this->getUrl('*/*/afhalenmail')}')"
            ));
        parent::__construct();
    }
}

app/code/local/Bromo/Orderstatus/controllers/Adminhtml/Sales/OrderController.php

<?php
require_once 'Mage/Adminhtml/controllers/Sales/OrderController.php';

class Bromo_Orderstatus_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController {

    public function afhalenmailAction() {

         echo 'Test action';

    }

}

Who would be so kind to be able to tell me what i'm missing here?

Edit1:
The button is showing absolutely fine, works too (goes to the correct page with showing an confirm message beforehand). Cache etc has already been refreshed.

The problem lays somewhere in my custom controller not being called or some sort.


texts:
I am getting this error in admin custom module of Magento 2.

  Something went wrong with processing the default view and we have
  restored the filter to its original state. admin grid error.


texts: Add new details to confirmed order in backend using a form?

texts:
I want user's specific measurement for product. So once order is placed, we will send a confirmation mail with a link of form. When user will open that link, a form will open. In that form user can fill the measurements form field. And i want to save those details from form into Order details So in backend these details will be added with order details. So is there any extension or solution for this?
Thanks


texts: Adding Order# to Payment Transaction Failed template

texts:
Is there a way to add the order# to a payment Transaction Failed email?

This is what I tried:

{* This is a comment block

Use vars: {{var var_name}}
*}

            Payment transaction failed.

                    Order Number:

                    {{var order_id}}

                    Reason

                    {{var reason}}

However, no order# came through...Even tried using the QUOTE reserved_order_id:

"var reserved_order_id":"order_id"

Still nothing.


texts: Display All On Sale/Special Price items in Magento on a page

texts:
If you want to set an item "On Sale" in Magento you have to set a "Special Price". Special prices enable you to define a discounted price for a product for a specified period of time.

My question is how can I add a link in my layered navigation to display all my "On Sale"/"Special Price" items.

Thanks


texts: Adding a CSS file which isn't in your custom theme to Layout xml file

texts:
We have a stylesheet that is present in a theme from an old website, since we want to keep the same overall template files but only change styles, we want to keep the old stylesheet and add another stylesheet in a new theme to override some colors and such.

E.g.

Old Theme

/skin/frontend/oldtheme/css/style.css

New theme

/skin/frontend/newtheme/css/style.css

Layout XML

<action method="addItem">
        <type>skin_css</type>
        <name>css/style.css</name>
        <params/>
</action>

Since the theme has been changed to a new theme, only the new stylesheet will be loaded and not the old one. I was wondering if there is a way to directly reference a CSS file that's not in the currently used theme.

I tried this:

<action method="addItem">
        <name>skin/frontend/oldtheme/css/style.css</name>
        <params/>
</action>

But it doesn't seem to be able to reference the old theme's CSS file.

Is there a way to directly reference a CSS file with a longer path?

Thanks


texts: Magento2: How to use different implementations of an interface

texts:
I am creating supplier imports. In order to do this, I created a base module "ProductImportBase" and two supplier specific modules "ProductImportA" and "ProductImportB". The base module contains stuff like readers for different data (csv, xml etc.) and an import helper. It also defines Api\SupplierSpecificInterface which is implemented in ProductImportA\Helper\ASpecific and ProductImportB\Helper\BSpecific.
The ProductImportBase\Helper\Import looks like a bit like this (simplified):

public function __construct(
    ...
    \Fd\ProductImportBase\Api\SupplierSpecificInterface $supplierSpecific,
    ...
) {
    ...
    $this->supplierSpecific = $supplierSpecific;
    ...
}

public function processImport()
{
    return $this->supplierSpecific->getProductDataRows();
}

I created an abstract controller AbstractImport with Fd\ProductImportBase\Helper\Import being injected in the constructor. Both modules extend this AbstractImport in ProductImportA\Controller\AdminHtml\A\Import and ProductImportB\Controller\AdminHtml\B\Import, respectively.

ProductImportA/etc/di.xml looks like this:

<type name="Fd\ProductImportBase\Helper\Import">
    <arguments>
        <argument name="supplierSpecific" xsi:type="object">Fd\ProductImportA\Helper\ASpecific</argument>
    </arguments>
</type>

ProductImportB/etc/di.xml looks like this:

<type name="Fd\ProductImportBase\Helper\Import">
    <arguments>
        <argument name="supplierSpecific" xsi:type="object">Fd\ProductImportB\Helper\BSpecific</argument>
    </arguments>
</type>

Now, I expected that when going to admin/productimport/a/import, ASpecific would be used and when going to admin/productimport/b/import, BSpecific would be used. What actually happens is that in both cases BSpecific is used (ProductImportB comes after ProductImportA in the modules list). Did I misunderstand the di concept? Do I need to approach this differently?
This is on Magento 2.2.4, btw.


texts:
In magento sales quote,

There's price and base_price and I can't find the difference between the two


texts: Any idea how to extend vendor/magento/framework/Data/Collection.php

texts:
Need help if there is a way to extend "vendor/magento/framework/Data/Collection.php" in order not to touch the core file while waiting for Magento 2 fix the issue.

Thanks,
JM


texts: How do I move a block to the top of the sidebar?

texts:
I have created a block in the backend of Magento and using the below code added it to the category page-

<page>
 <body>
    <referenceBlock name="page.main.title" remove="true"/>
    <referenceBlock name="category.description" remove="true"/>
    <referenceContainer name="sidebar.main">
        <block class="Magento\Cms\Block\Block" name="filteredby">
            <arguments>
                <argument name="block_id" xsi:type="string">filteredby</argument>
            </arguments>
        </block>
    </referenceContainer>
</body>
</page>

The image shows up, but it shows up at the bottom of the container. So I tried moving it in that file with this code-

<move element="filteredby" destination="sidebar.main" before="-"/>

and it didn't work. So I tried the same code in my default.xml and in my catalog_category_view_type_layered.xml. I cleared the cache everytime after I made the change and still nothing. Am I not placing the code in the correct place or is the code wrong?


texts: Adding values dynaamically in less files

texts:
I have created a theme and had configuration for the colours and background configuration in backend.
I want those values to be replaced in the less file.Can it be achieved.If so please guide me to how to do that.


texts:
On my hosting not working Login block on Checkout page. After login it redirect on same page. I tested on my local environment - all works fine. I have saw that on hosting not enter into two IF blocks in CustomerController (line 220):

if (!$session->getAfterAuthUrl()) {
   $session->setAfterAuthUrl($session->getBeforeAuthUrl());
}
if ($session->isLoggedIn()) {
   $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
}

I used Magento 1.9.2.0. I have upgraded to 1.9.2.4, but it not help.


texts: how to display custom dowpdown with custom values in admin grid of magento?

texts:
I am trying to display custom dropdown in admin grid of Magento.
i have added in database income_source attribute as a enum. with values 'C' 'I' and after saving this I want to display it on admin panel grid with label 'customer''incentives' .

I have added this code in
protected function _prepareColumns() function

$attribute = Mage::getModel('contactus/contactus')->getAttribute('wel_contactus', 'income_sourcer');
$options = array();
foreach( $attribute->getSource()->getAllOptions(true, true) as $option )     {
   $options[$option['C']] = $option['Customer'];
   $options[$option['I']] = $option['Incentives'];
}
$this->addColumn('income_source',
array(
    'header'=> Mage::helper('contactus')->__('Income Source'),
    'width' => '80px',
    'index' => 'income_source',
    'type'  => 'options',
    'options' => $options,
));

But it showing error

  Fatal error: Call to a member function getSource() on a non-object.
  thanks in advance.


texts:
I have a problem with my project.
I am newer and use Ui component in  my sale history table the filed parent_id is the order id in sales_order.

When the ui component request data, I can not filter data using order id because there is not order id in my history table.

How can I do when I send order id as a parameters and it can adapt the history id at same time?

Thank you


texts: How to set values in custom email templates?

texts:
I am trying to customize new order email template for that I have done below code.

here is my email_templates.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="order_template" label="Template File" file="email_template.html" type="html" module="Pulsestorm_HelloWorldMVVM" area="frontend"/>
</config>

and here is my email_template.html

{{template config_path="design/email/header_template"}}

{{trans "%customer_name," customer_name=$myvar3}}

                {{trans "Your custom message."}}
                {{trans 'Your custom message logging into your account.' account_url=$this.getUrl($store,'admin',[_nosid:1]) |raw}}

{{trans 'Your Order #%increment_id' increment_id=$myvar1 |raw}}

{{trans 'Placed on %created_at' created_at=$myvar2 |raw}}

{{trans "Billing Info"}}

{{var myvar4|raw}}

                        {{trans "Item"}}
                        {{trans "Sku"}}

                    {{var myvar8|raw}}

{{template config_path="design/email/footer_template"}}

here is my execute function (observer)

 public function execute(\Magento\Framework\Event\Observer $observer)
    {

    $orderIds = $observer->getEvent()->getOrderIds();
    $order = $this->_orderRepositoryInterface->get($orderIds[0]);
    $items =$order->getAllVisibleItems();
    $productIds = array();
    foreach($items as $item) {
        $productIds[]= $item->getProductId();
    }
   $customerEmail = $order->getCustomerEmail();
   $templateOptions = array('area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $this->storeManager->getStore()->getId());
   $templateVars = array(
            'store' => $this->storeManager->getStore(),
            'message'   => 'We processed your order ID We will contact you soon in mail for the acknowledgement if you not receive mail within 4 hours please get help from support@xxx.com'
        );
        $from = array('email' => "ramkishan.suthar@ranosys.com", 'name' => 'Ramkishan');
        $this->inlineTranslation->suspend();
        $to = array($customerEmail);
        $transport = $this->_transportBuilder->setTemplateIdentifier('order_template')
            ->setTemplateOptions($templateOptions)
            ->setTemplateVars($templateVars)
            ->setFrom($from)
            ->addTo($to)
            ->getTransport();
        $transport->sendMessage();
        $this->inlineTranslation->resume();

   }

now i want to ask that how can i set values in email_template.html


texts: Create a category programatically in frontend don't work

texts:
I have tried for hours to create programatically a new category under the root category.

My code so far:

$parentCategory = Mage::getModel('catalog/category')
    ->load(Mage::app()
        ->getStore()
        ->getRootCategoryId()
    );

$category = Mage::getModel('catalog/category');
$category->setStoreId(1);
$rootCategory['name'] = 'Bananaaa';
$rootCategory['path'] = $parentCategory->getPath();
$rootCategory['display_mode'] = "PRODUCTS";
$rootCategory['include_in_menu'] = 1;
$rootCategory['is_active'] = 1;
$rootCategory['is_anchor'] = 1;
$category->addData($rootCategory);
try {
    $category->save();
    echo $rootCategoryId = $category->getId();
}
catch (Exception $e){
    echo $e->getMessage();
}

The result is:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`new_shop`.`catalog_category_flat_store_1`, CONSTRAINT `FK_CAT_CTGR_FLAT_STORE_1_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`))

When I try to use "0" for I guess Admin-Store then the error message says that there is no table "catalog_category_flat_store".
No it isn't because there is only "catalog_category_flat_store_1" in the database.

I run this action from a controller and use the browser to start it.


texts: Live to local development - redirecting to live site

texts:
I'm new to Magento (using 1.6.1) and I'm getting very frustrated with it!

Whenever I type my virtual host url into the browser "http://website" it goes straight to the live site.

I've googled the problem over and over to no avail unfortunately.

I've tried:

changing the secure and unsecure paths in core_config to point to http://website
clearing out everything from var/cache
checking local.xml to make sure it was accessing the correct DB
checking .htaccess to make sure there wasn't a redirect in there.

I've looked at similar or the same questions on here and I can't seem to find my solution!

Please let me know if I have missed any key information out.

Any help would be greatly appreciated!


texts: Which Image optimizer extension is good for version 1.9.1.0?

texts: My site always gets an error of image optimization in PageSpeedInsights tool. I want to know if there is any provision of extension for the same or only code will help.


texts:
I am creating an attribute for product called supplier(Select).
Question 1
in which table the values of the supplier attribute are saving While adding the product?

Question 2
i want to retrieve the orders product according to supplier attribute.is their any possibilities to filter order according to this supplier selection.


texts: Magento 2 - Add success message with knockout

texts:
I need add an errorMessage or successMessage on checkout/cart after an jquery validation. I tried require file 'Magento_Ui/js/model/messageList' for this but not have success.

My code:

define(
    [
        'jquery',
        'Magento_Ui/js/model/messageList'
    ],
    function ($, messageList) {
       $.ajax({
           type: "GET",
           url: /route/controller,
           async: false,
           success: function (res) {
               if (res.val) {
                  messageList.addErrorMessage({'message': messageError});
               }
           }
       });
    }
);


texts:
Im trying to install sitemap module for Magento 2 and i got this message via cli, i make some changes in composer.json

   {
"name": "mageplaza/module-sitemap",
  "minimum-stability":"dev"
  "description": "Magento 2 Google XML Sitemap extension",
  "require": {
    "mageplaza/module-core": "^1.3.11",
    "mageplaza/magento-2-seo-extension": "^2.1.0"
    "mageplaza/module-sitemap": "@dev"
  },
  "type": "magento2-module",
  "version": "2.1.0",
  "license": "proprietary",
  "authors": [
    {
      "name": "Mageplaza",
      "email": "support@mageplaza.com",
      "homepage": "https://www.mageplaza.com",
      "role": "Technical Support"
    }
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Mageplaza\\Sitemap\\": ""
    }
  }
}

but i cant install it ... any suggest?


texts: How to change the max limit of the attribute according to the unit?

texts:
I have a unit length that accept entering cm, inch and ft. I know how to set-up the input validation in one limit. Let say, I want to have max limit to 100cm. I can set the field validation to the following:

<input name="length" type="text" data-validate="{required:true, max:100}" />

And let say, I have a select field that contain the unit of length:

<select name="unit">
    <option value="cm">cm</option>
    <option value="inch">inch</option>
    <option value="ft">ft</option>
</select>

The problem is: If I enter 100ft or 100inch,  the validation still pass. How can I adjust the max value when I switch the unit? So that 100ft or 100inch cannot pass the validation.


texts: Can't upload product placeholder images in Magento 2

texts:
I'm trying to replace the Magento placeholder image with a custom one. Everything I browse to select the file and hit Save, nothing gets saved.

Is there an issue with this in v2.2.6?

What can I do to resolve this?


texts: Magento 2 User Admin image upload $_FILES empty

texts:
I'am trying to add a field to upload image for specific user. I add field but problem is when I try save User. Image isn't uploaded and I got exception that $_FILES is empty. I followed these instructions:

Magento2 : Admin module Image upload code to display form

How to successfully upload image?


texts: Url key was already generated for an item with the SKU Import File

texts:
When I import product CSV in Magento 2.3.5. I am getting the error as below1.
Url key: '471-010-transparente' was already generated for an item with the SKU: '471_010-Transparente-40'. You need to specify the unique URL key manually in row(s): 4, 5, 6
Please help me.


texts: Magento 2: Suggestion to speed up minicart quantity update

texts:
I have changed minicart quantity plus, minus button to update the cart in real time.

These buttons update cart by making an ajax call.

This round trip to the server takes time and user experience is bad if they click plus or minus with repeatedly very quickly.

Any suggestion to handle this user experience issue?

Regards,


texts:
I have installed Magento 2.2.6 in Google cloud VM. It is a fresh install and when I try to save a simple product, I get the following error:

  "Unable to save Stock Item"

My exception log shows the following error:

/var/www/html/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php:183,

I'm stuck in this error and not sure about the solution:
I to tried decompile, upgrade, cache clean, cache flush, static deploymenI'mbut I'm unable to solve this issue.

I applied chmod 777 to the /var/www/html/app/code folder but unable to rectify the error.


texts: Magento install B2B module causing issues

texts:
I am trying to install the module B2B module in my commerce Magento project. However, I am getting below error

Your requirements could not be resolved to an installable set of packages.

  Problem 1

  Installation request for magento/module-checkout == 100.2.5.0 -> satisfiable by magento/module-checkout[100.2.5].

  magento/extension-b2b 1.1.2 requires magento/module-checkout-address-search-negotiable-quote 100.1.0 ->
  satisfiable by
  magento/module-checkout-address-search-negotiable-quote[100.1.0].
  magento/module-checkout-address-search-negotiable-quote 100.1.0 requires magento/module-checkout 100.3.2 -> satisfiable by
  magento/module-checkout[100.3.2].
  Conclusion: don't install magento/module-checkout 100.3.2
  magento/extension-b2b 1.1.1 requires magento/module-shared-catalog 100.1.1 -> satisfiable by
  magento/module-shared-catalog[100.1.1].
  magento/module-shared-catalog 100.1.1 requires magento/module-user 101.1.1 -> satisfiable by
  magento/module-user[101.1.1].
  Conclusion: don't install magento/module-user 101.1.1
  Can only install one of: magento/module-user[101.1.0, 101.0.3].
  Can only install one of: magento/module-user[101.1.0, 101.0.3].
  Can only install one of: magento/module-user[101.0.3, 101.1.0].
  magento/module-shared-catalog 100.1.0 requires magento/module-user 101.1.0 -> satisfiable by
  magento/module-user[101.1.0].
  magento/extension-b2b 1.1.0 requires magento/module-shared-catalog 100.1.0 -> satisfiable by
  magento/module-shared-catalog[100.1.0].
  Installation request for magento/extension-b2b ^1.1 -> satisfiable by magento/extension-b2b[1.1.0, 1.1.1, 1.1.2].
  Installation request for magento/module-user == 101.0.3.0 -> satisfiable by magento/module-user[101.0.3].

  Installation failed, reverting ./composer.json to its original
  content.

Can anyone has an idea about this issue

Thanks in advance


texts:
Access to font at '/fonts/fontawesome-webfont.woff?v=4.7.0' from origin 'https://www.origin.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Magento 2 https://www.origin.com, we created CloudFront for static and for media files.
I get this error for all fonts woff,woff2 and ttf and also js-translation.json.

My ngnix settings:

location / {
try_files $uri $uri/ /index.php$is_args$args;
    location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
    add_header Access-Control-Allow-Origin * always;
    }
    location ~* \.(eot|ttf|woff|woff2)$ {
    add_header Access-Control-Allow-Origin * always;
}
}
location /pub/ {
location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
    deny all;
}
location ~* \.(eot|ttf|woff|woff2)$ {
    add_header Access-Control-Allow-Origin * always;
}
alias $MAGE_ROOT/pub/;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Frame-Options-2 "SAMEORIGIN-2";
}

I also updated setting on CloudFront from here
https://aws.amazon.com/premiumsupport/knowledge-center/no-access-control-allow-origin-error/

Also tried NGINX cross control origin header added but font files still blocked by CORS policy

Nothing helps. Please advise


texts: Getting Error for custom SOAP API for Magento2 failed to load external entity

texts:
I have followed this link https://inchoo.net/magento-2/magento-2-custom-api/ but getting error.
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://127.0.0.1/m232/soap/default?wsdl&services=inchoHelloV1' : failed to load external entity "http://127.0.0.1/m232/soap/default?wsdl&services=incho
HelloV1" in E:\xampp\htdocs\m232\vendor\zendframework\zend-soap\src\Client\Common.php:33 Stack trace: #0 E:\xampp\htdocs\m232\vendor\zendframework\zend-soap\src\Client\Common.php(33): SoapClient->SoapClient('http://127.0.0....', Array) #1 E:\xampp\htdocs\m232\vendor\zendframework\zend-soap\src\Client.php(1070): Zend\Soap\Client\Common->__construct(Array, 'http://127.0.0....', Array) #2 E:\xampp\htdocs\m232\vendor\zendframework\zend-soap\src\Client.php(1245): Zend\Soap\Client->initSoapClientObject() #3 E:\xampp\htdocs\m232\vendor\zendframework\zend-soap\src\Client.php(1156): Zend\Soap\Client->getSoapClient() #4 E:\xampp\htdocs\m232\testapi1.php(32): Zend\Soap\Client->__call('softwebCustomap...', Array) #5 {main} thrown in E:\xampp\htdocs\m232\vendor\zendframework\zend-soap\src\Client\Common.php on line 33


texts: Magento 2 : Not assign simple product as associated in configurable products after migration from 1.8.0.0

texts: I have migrated the store from Magento 1.8.0.0 to Magento 2.3.5 after checking Simple Products not assign as associated in configurable products. I also check in admin side configurable product, the associated products tab show blank.


texts: Magento 2: Reauthorize braintree payment

texts:
I want to reauthorize a transaction which has expired.

I am new to magento, can anyone help me to inherit the braintree module and rauth the payment?

I am using magento 2.2.4 version.


texts: Magento installation on live server is throwing error

texts:
I am trying to install Magento 2 fresh copy on Live Server but it is throwing the below error

What i did:

Downloaded Magento 2 latest CE version
Uploaded to server root directory
Unzip then
Visit my website shop.site.com/setup
And it throws the below error

  Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or
  view not found: 1146 Table 'databasemy.store_website' doesn't
  exist in
  /var/www/vhosts/shop.site.com/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228
  Stack trace: #0
  /var/www/vhosts/shop.site.com/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php(228):
  PDOStatement->execute(Array) #1
  /var/www/vhosts/shop.site.com/httpdocs/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(93):
  Zend_Db_Statement_Pdo->_execute(Array) #2
  /var/www/vhosts/shop.site.com/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303):
  Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array) #3
  /var/www/vhosts/shop.site.com/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480):
  Zend_Db_Statement->execute(Array) #4
  /var/www/vhosts/shop.site.com/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238):
  Zend_Db_Adapter_Abstract->query('SE in
  /var/www/vhosts/shop.site.com/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php
  on line 235


texts: magento 1.9 observer on quantity product change

texts:
I can't find the event for quantity product change for magento 1.9.
I need to do something after a quantity product is updated from backend and frontend, when a user buy a product and decrease quantity, when a quantity is updated from admin page and when is updated from a script then programmatically.

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <Test_Testing>
        <version>1.0.0.0</version>
    </Test_Testing>
</modules>
<global>
    <events>
        <??>
            <observers>
                <test_testing_obs>
                    <class>Test_Testing/observer</class>
                    <method>move_products_category</method>
                </test_testing_obs>
            </observers>
        </??>
    </events>
</config>


texts: Importing products - process lasts forever

texts:
I have two Magento 1.7.0.2 installations: one is on a shared hosting installed using cPanel and the other is a local install I've done on my Ubuntu Server 12.04 machine.

Since the one on the shared hosting is just for learning and demo purposes, and I have now setup the local one, I need to import the list of products into the local install.
For this I have a csv file comprising of 2685 products.

When I begin the import procedure and select the csv file and "check data", validation results show:

Checked rows: 2685, checked entities: 2685, invalid rows: 0, total errors: 0

File is valid! To start import process press "Import" button

The problem I'm facing is, that when I click import button, only about 1600 or 1700 items are imported and the import procedure seems to run forever till I stop it.

The same csv file imports perfectly into the shared hosting version.

Would really appreciate some help on this, pls.


texts: Billing Address: how to add 2 new fields easly

texts:
I need advice. I have to enter two new fields in the billing address form, for electronic invoicing (italy).
is there a module from which I can start to do this?
or do you have an advice to be able to do it quickly and without problems?
thank you


texts: Preselect table values in the system configuration

texts:
I used this example to create my own table with configuration in admin. Now I'm trying to figure out how to preselect my saved values on page loads. I have this table now:

For preselecting this example uses _prepareArrayRow()

This is value from core_config _data:

a:4:{s:18:"_1486995392381_381";a:3:{s:12:"m2_attribute";s:16:"required_options";s:13:"chq_attribute";s:14:"CustomDecimal1";s:9:"push_once";s:5:"false";}s:18:"_1486995402858_858";a:3:{s:12:"m2_attribute";s:14:"fabric_content";s:13:"chq_attribute";s:6:"Rental";s:9:"push_once";s:4:"true";}s:18:"_1486995407176_176";a:3:{s:12:"m2_attribute";s:9:"fabricfit";s:13:"chq_attribute";s:13:"CustomNumber3";s:9:"push_once";s:4:"true";}s:17:"_1486995414029_29";a:3:{s:12:"m2_attribute";s:17:"short_description";s:13:"chq_attribute";s:17:"ItemCustomNumber6";s:9:"push_once";s:5:"false";}}

This is how unserialized value looks like:

Array
(
    [_1486995392381_381] => Array
        (
            [m2_attribute] => required_options
            [chq_attribute] => CustomDecimal1
            [push_once] => false
        )

    [_1486995402858_858] => Array
        (
            [m2_attribute] => fabric_content
            [chq_attribute] => Rental
            [push_once] => true
        )

    [_1486995407176_176] => Array
        (
            [m2_attribute] => fabricfit
            [chq_attribute] => CustomNumber3
            [push_once] => true
        )

    [_1486995414029_29] => Array
        (
            [m2_attribute] => short_description
            [chq_attribute] => ItemCustomNumber6
            [push_once] => false
        )

)

Any help will be appreciated!


texts: How to show image in custom grid in magento 2 backend using layout only?

texts: I am trying to display image on custom grid in back-end using layout but not idea how to show it. I know image show using ui_component & block but i need to show using layout only. Please help me.


texts:
I want to change the price of a particular product via a module but it is not working. I have searched and found a lot of solutions but none is working for me. I'm relatively new to Magento, I'm missing something but don't know what.. The stock is changing but the price isn't.

This is my code:

require_once('app/Mage.php');
umask(0);
Mage::app();

$sku = 170994;
$stock = 20;
$price = 17.95;

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
if ($product) {
    $productId = $product->getId();
    $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
    $stockItem->setData('qty', $stock);
    if($stock <= 0){
        $stockItem->setData('is_in_stock', 0);
    } else {
        $stockItem->setData('is_in_stock', 1);
    }
    $stockItem->setPrice($price);
    echo $stockItem->getPrice() . '<br>';
    $stockItem->save();
/*
    $process = Mage::getModel('index/process')->load(2);
    $process->reindexAll();
*/
    unset($stockItem);
    unset($product);
    echo 'done';
} else {
    echo 'no product found';
}

And I have added this code as well but then nothing happens:

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

Please help me, thanks!


texts: How to properly integrate Magento 2 with Cloudflare cache

texts:
I just enabled Cloudflare cache with my magento 2.3.4 , the problem is most of the image and js file cache status is always MISS:

Is this related to the server configuration or magento 2 .htaccess ?
My server currently running on CentOS apache server


texts: eliminate render blocking resource in magento 1.9

texts:
how to eliminate render blocking resource, please give some solution.

and in below URL
https://example.com/media/css_secure/A.67235d48adca9db7ca959bc3a5076d7a.css.pagespeed.cf.Zdz540Fens.css

what is that pagespeed.cf.Zdz540Fens.css extension in above URL and how to remove that file.


texts: Magento 2 paytm order conformation mail getting before payment

texts:
Customer chooses to pay by Paytm -> Is redirected to Paytm gateway -> Magento IMMEDIATELY sends out an Order Confirmation Email to the customer, before he even completes the payment.

Customer shuts down browser without making payment because he thinks he paid already.
Magento says the order is processing so I (a seller) assume payment has been completed. But when I manually check the payment status in merchant.paytm.com - payment hasn't been made at all (customer closed browser after full page load).

How to set up Magento/Paytm extension, so that the Order confirmation is sent to customer AFTER he completes the payment?


texts: Magento2: I need to create custom dropdowns attribute changes the values on the basis of another dropdown attribute in catalog product admin

texts:
I have two dropdown attributes in admin
 1. Product dropdown attribute - m1(val1, val2, val3) m2 (val1, val2)
 2. Material dropdown attribute  - m1, m2

if m1 - val1, val2, val3
if m2 - val1, val2

I need to change the values of product dropdown attribute on the selection of Material dropdown values m1 and m2

Anyone have an idea?

Thanks


texts:
I am getting this error no product category page

  1 exception(s): Exception #0
  (Magento\Framework\Config\Dom\ValidationException): Element
  'referenceContainer': This element is not expected. Expected is one of
  ( action, arguments, block, container, referenceBlock, uiComponent ).
  Line: 684

  Exception  0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'referenceContainer': This element is not expected. Expected
  is one of ( action, arguments, block, container, referenceBlock,
  uiComponent ). Line: 684


texts: Redirecting Magento to domain root from sub-folder 500 error

texts:
My magento site is stored in a sub-folder of my root domain mydomain.com/magento - I am trying to get the site working at mydomain.com (leaving admin available at mydomain.com/magento/admin).

I have updated the base url store view in admin panel to mydomain.com/ as suggested in another post on stack exchange. I have also copied the index.php to the root folder and updated this line (47):

$mageFilename = MAGENTO_ROOT . '/magento/app/Mage.php';

I have only updated the line in the index.php located in root - not the one located in the /magento/ folder.

Unfortunately, something has gone wrong as when I visit the site via mydomain.com/ I get a 500 error. The site is still accessible via mydomain.com/magento and the admin is also fine.

Can anyone please suggest a fix?


texts:
I'm having some serious issues finding the place where i can change the image for the diffrent boxes i have on my frontpage. I've been under CMS --> Pages --> Design, but i dont seem to find the place, where i can switch out the image i want showcased.

The website is: www.h-copenahgen.com

Please see attached picture:


texts:
My issue is I have two duplicate websites one for dev purpose and one is my live site.

When I change for example the theme color and flush the cache, working perfectly, color is changing.

But when I do the same thing on my Live site nothing changes.
I tried all the commands:

php70 bin/magento setup:upgrade;
rm -rf generated/*;
rm -rf pub/static/*;
rm -rf var/cache/*;
rm -rf var/page_cache/*;
rm -rf var/composer_home/*;
rm -rf var/view_preprocessed/*;
rm -rf var/cron/*;

php70 bin/magento setup:di:compile;

php70 bin/magento setup:static-content:deploy;

redis-cli flushall;
php70 /opt/magemojo/bin/n98-magerun2.phar cache:flush;
php70 bin/magento indexer:reindex;
php70  bin/magento cache:clean;
php70 bin/magento cache:flush;

Any idea?


texts: how to remove Open Sans font in magento 2

texts: I need to remove Open Sans font in our Magento2 site. I have inherited the luma theme, so how to override the blank theme _typography.less file?


texts: Magento2 module not getting installed with git clone from local repo

texts:
I am trying to install a module Abcd_Core using the command

sudo php bin/magento setup:upgrade

The output does list all the modules except Abcd_Core. Also the app/etc/config.php does not have Abcd_Core in the array.

Here is what I did..

The module is located at <magento>/app/code/

The file

app/code/Abcd/Core/registration.php

has the code

\Magento\Framework\Component\ComponentRegistrar::register(
     \Magento\Framework\Component\ComponentRegistrar::MODULE,
     'Abcd_Core',
     __DIR__
 );

In app/code/Abcd/Core/etc folder I have module.xml, di.xml files and a folder adminhtml.

module.xml

 <?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
 <module name="Abcd_Core" setup_version="1.0.0" />
 </config>

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Store\Model\Store" type="Abcd\Core\Model\Store" />
</config>

The app/code/Abcd/Core/etc/adminhtml folder has routes.xml and system.xml.

There is a file app/code/Abcd/Core/Model/Store.php which overrides the functionality of method getBaseUrl().

I tried cleaning the cache and then running the setup:upgrade several times, also tried

sudo php bin/magento module:enable Abcd_Core

but unable to install/enable the module.

Can anyone provide some input on what needs to be corrected?

FYI, I cloned the files from a git repository in my organization.

Thank you,
Hari CL


texts: Magento 2 Theme widgets for child theme not showing

texts:
Good Afternoon,
I have my base theme "default" for my site and it contains 45 widgets and these work as expected. I need to make a change  in terms of display and styles for one of my stores named "uk". I have created a theme added my styles and applied the styles, but the widgets that were working to create the homepage no longer work with the child theme, they simply do not show. I have double checked my theme setup and the parent > child relationship is correct, my theme applies without issues and the static content is generated for all themes.
During my review of the issue, I have noticed that all the widgets are assigned to the default theme in the database and I am unable to update the theme in the admin panel as it is disabled as a field.
I was wondering if there is a way to assign a widget to more than one theme or to duplicate the widgets for the new child theme?
I have checked stack exchange but the only relatable answer I could find was a database query to change the theme ID:
[https://magento.stackexchange.com/questions/239030/widgets-not-loads-after-creating-custom-theme-magento-2]
But I was hoping for a solution that would work for all themes.
Any help would be very welcome.


texts: Magento : Pass Image Id to Another Product

texts:
We have Two product, First which has many images and second is sample product of that product. we don't want to upload same product images as first product already have that. we just want to pass that image id to sample product.

Any idea?

https://drive.google.com/file/d/0B16pwFWrEtUVV0pjR0dxUDlHakE/view?usp=drivesdk


texts: Trying to style notification bar extension and the changes are not applying from styles.css

texts:
https://www.magentocommerce.com/magento-connect/notification-bar.html

I have installed this extension and it says I should be able to style it with my own CSS.

Even when targeting #notification-bar in my styles.css and changing the background-color, the changes are not applying, even when using !important.

Why is this happening?


texts: Send email depend group of customer, when order is pendding

texts:
i have 6 groups in my store , but i want to send email when a customer makes  order, but this email need to be sending specific email,
example, if customer is in group 3 i want to send to admingroup3@mystore.com, the email order need to be sending to admin email depend of group!!!

And i have another problem, que email orders are sending to my personal email like cc, and i cant find into system configuration, my email, i dont know if this is a problem with the datebase or something like that!!!


texts: Save cart price rule custom fields in database

texts:
I need to save values of two custom fields which I have added using xml.
Below is the xml in which I have added that fields also they reflect in cart price rule form.

 <fieldset name="custom details">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true"> Detail1</item>
            <item name="collapsible" xsi:type="boolean">true</item>
            <item name="sortOrder" xsi:type="string">40</item>
        </item>
    </argument>
    <field name="field1">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">i</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">sales_rule</item>
                <item name="dataScope" xsi:type="string">field1</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>
    <field name="field2">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">wysiwyg</item>
                <item name="source" xsi:type="string">sales_rule</item>
                <item name="label" xsi:type="string">Field2</item>

                <item name="template" xsi:type="string">ui/form/field</item>
                <item name="wysiwyg" xsi:type="boolean">true</item>
                <item name="dataScope" xsi:type="string">terms_conditions</item>
                <item name="sortOrder" xsi:type="number">50</item>
                <!--<item name="rows" xsi:type="number">8</item>-->
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>

            </item>
        </argument>
    </field>
</fieldset>

I am struggling as on how shall I save the values of two fields in the database against their database field columns.I tried to go through save.php in Namespace/Modulename/Controller/Adminhtml/Promo/Quote/Save.But could find any success in that.
Can someone please help.


texts: VirtualAlloc()failed:[0x00000008]Not enough memory resources available to process this command

texts:
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
PHP Fatal error:  Out of memory (allocated 1218445312) (tried to allocate 134217728 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 90
While installing data migration tool using composer.
I have set the memory_limit=-1 in php.ini file.


texts: How to remove shipping price from checkout and from order mail?

texts: Can anybody help me with a solution to remove the shipping price in the checkout process, and also in the order email. Right now it is set to 0,00 but I want to remove the price, so only the delivery text is displayed.


texts: How to make "view all" link in topmenu with sub categories

texts:
I am trying to add a "view all" link to show under the main categories in my main menu.

Right now it would show:

  category1
    - subcat1
    - subcat2
    - subcat3
  category2
    - subcat1
    - subcat2
    - subcat3

I am trying to make it show:

  category1
    - subcat1
    - subcat2
    - subcat3
    - view all
  category2
    - subcat1
    - subcat2
    - subcat3
    - view all

Here is the menu code I am working with.

<?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>
<div id="<?php echo $menu_type ?>" class="nav-container<?php if($menu_stay_on_top): echo " stay-top"; endif;?>">

        <?php echo $_menu ?>
        <?php if (($block_custom_menu = $this->getLayout()->createBlock('cms/block')->setBlockId('block_custom_menu')->toHtml()) && $menu_type == 'wide-menu'): ?>

<?php echo Mage::getModel('cms/block')->setStoreId(Mage::app()->getStore()->getId())->load('block_custom_menu')->getTitle(); ?>

                <?php echo $block_custom_menu;?>

<?php echo Mage::getModel('cms/block')->setStoreId(Mage::app()->getStore()->getId())->load('block_custom_menu')->getTitle(); ?>

        <?php endif;?>

I just need to add a "view all" link at the bottom of the list of sub categories (only those 2 levels), which will just link to that sub category. So a duplicate link of the sub category but named view all.

Any guidance would be greatly appreciated.


texts: How to remove this paragraph tags in magento admin

texts:
I have added some text using WYSIWYG editor and want to show in admin side but its showing with paragraph tag

How to remove this tags


texts:
I am new with magento and odoo. I want to use magento2 for frontend and odoo for backend. I have serached all over google and youtube.

  how to integrate magento2 and odoo ?

But I did not get any  good tutorial or installation guide.

Can you provide me some tutorial or guide ?

I am using ubuntu server 16.04 lts (only cli).

Running on windows machine 192.168.0.50 server ip.


texts: Magento 2: Admin Set to "Default Store View"

texts:
Magento 2: Import Script Store Id Related Issue

Would like to set Admin to "Default Store View" instead of "All Store Views".

How to do it? Is it good idea to achieve my requirement?


texts:
i need add custom page template toolbar with sort by and pagination, because my template custom page shows a list of sub-categories in this category and need add pagination with sorting

Thanks


texts: I'm wondering if there is any possibility of creating Custom Table outside install or update script, and without using the query("CREATE TABLE statement"), in Magento 1.9+


texts: module behaving normally on one server and giving 404 on other

texts:
I added a custom module to a fresh install of magento on my local (mac). Since setting this up I needed to add the site to another computer (kubuntu).

On the kubuntu I cloned the git repository and the site works as expected but if I view pages belonging to the module it returns a 404.

Both the mac and kubuntu have identical database and code.

Unless someone thinks it's necessary i'm not going to post the code for the module because I can't see that being an issue given that it works on the mac. I assume this has to be a config issue somewhere but where?

config.xml

   <?xml version="1.0" encoding="UTF-8"?>

 <config>

<modules>

    <Graphicalliance_Dynamicblocks>
        <version>0.0.1</version>
    </Graphicalliance_Dynamicblocks>

</modules>
<frontend>
    <routers>
        <Dynamicblocks>
            <use>standard</use>
            <args>
                <module>Graphicalliance_Dynamicblocks</module>
                <frontName>Dynamicblocks</frontName>
            </args>
        </Dynamicblocks>
    </routers>

    <layout>
        <updates>
            <graphicalliance_dynamicblocks>
                <file>dynamicblocks.xml</file>
            </graphicalliance_dynamicblocks>
        </updates>
    </layout>
</frontend>
<global>

</global>
</config>

Url to index action is http://edwardgreen.localhost/shop/Dynamicblocks/index

root to this is release-head/shop/app/code/local/GraphicAlliance/Dyanmicblocks/controllers/IndexController.php


texts: Change product sorting from desc to asc on category page

texts: When entering a category, I select the sorting type product name. Sorting shows products in desc mode (z-a) how to implement default asc mode (a-z)


texts: Magento2 add categories and products via Module

texts:
I would like to create a module ,where i can read and excel file & add products & categories from the code. I am new to magento so i don't now how to get started. Setting up a new module is no problem. There a very useful tutorials on the web.

Reading my excel file is not the problem, but how can ,i add products & categories. Should ,i work with the API or directly with product entities ?

Is there any guide on how to add categories & products via my module code?


texts: Best practices to use rest & soap together for client android app

texts:
I am working on Magento based m-commerce android app. In which I have to use both REST & SOAP web api. Because REST api didn't provide all functionality as SOAP. And to use only SOAP api for whole app will reduce app performance and also UX due to overheads and xml.

What is the best practices for doing this thing? Is there any simple option available?


texts: How to change the text of Go to Checkout button in minicart?

texts:
I want to change text

  "go to checkout" to "Get it now"

in the minicart.
Can anyone help me to do that ?


texts:
<?php echo $block->getChildHtml('control_buttons');?>

Found in

module-wishlist/view/frontend/templates/view.phtml

What is it calling? In the dev tools inspector I see some static content loading like this:

pub/static/version1498583309/frontend/Magento/luma/en_US/Magento_Ui/templates/collection.html

But there is not version folder in the directory!. So where is all the static HTML templates? pub/static/frontend/Magento/Luma... contains some static js and HTML but not what I'm looking for.


texts:
This question has been "half-answered" already here:
custom CSS-files for single storeviews

However I can't make it work just yet, so I need some additional explaining, if you'd be so kind.
This is the answer from the related question:

  Use the STORE layout handle:

<?xml version="1.0"?>
><layout version="0.1.0">
>    <STORE_en>
>        <reference name="content">
>            ...
>        </reference>
>    </STORE_en>
></layout>

  Where en is the code of the store in question. This will add the layout changes to all >pages for that store in the same way as the  layout handle does for all pages of >all stores. By default there is no way to use the STORE layout handle and only have >layout changes for certain pages in that store.

And this is where I need a bit more explaining:

</default>

<STORE_hafner_de>
    <reference name="header">
        <action method="addCss"><stylesheet>css/hafner.css</stylesheet><params>media="screen"</params></action>
    </reference>
</STORE_hafner_de>

that </default> is just to show that <default> is closed.

So how do I reference a block used in the <default> layout already, so I can add a css-file to the store-view in question (hafner_de)?

If you need more code or whole files, I'll be happy to provide you with those.
I know I'm going to need this often, because we are currently working on opening a multi-store with different layouts, images and css-files.

Thanks in advance

edit: If I understand this correctly, and I don't think I do, I have to add the code like this:

<STORE_hafner_de>
        <block type="page/html_head" name="head" as="head">
            <action method="addCss"><stylesheet>css/hafner.css</stylesheet><params>media="screen"</params></action>
        </block>
</STORE_hafner_de>

or do I say <reference name="header"> instead of <block name="head">
Because if I just add the css file, it's working (but for all stores)


texts: Magento 1 - Storing media files in the database

texts: I am wondering if anyone can provide an insight into how the config to store media files in the database works. A question I have is - there are many different types of media files. CMS, product images, and 3rd party extensions - are all these different types of media files supported with this option? Any potential issues to look out for?


texts: Programmatically create a custom product in Magento 2

texts:
I have created a custom product. i.e

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
    <type name="Dome" label="Event Dome Product" modelInstance="Mymodule\Example\Model\Product\Type\EventDome"
          composite="false" isQty="true" canUseQtyDecimals="false" sortOrder="83">
        <priceModel instance="Mymodule\Example\Model\Product\Type\Price"/>
        <customAttributes>
            <attribute name="refundable" value="true"/>
            <attribute name="is_real_product" value="false"/>
            <attribute name="taxable" value="true"/>
        </customAttributes>
    </type>
</config>

I now want to programmatically create products. The code below is employed on an admin controller page. It works, however, it does not create a fresh product but overrides the previously created product. i.e if I create a  product and then try and use the same form to create another one it deletes the previous one.

Also, I am unable to set a price.

$_product = $this->productFactory->create();

            $_product->setName($array['ProductName']);
            $_product->setTypeId('Dome');
            $_product->setAttributeSetId(4);
            $_product->setSku('test-SKU');
            $_product->setWebsiteIds(array(1));
            $_product->setVisibility(4);
            $_product->setPrice(array(350));
            $_product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
            $_product->setStockData(array(
                    'use_config_manage_stock' => 0, //'Use config settings' checkbox
                    'manage_stock' => 1, //manage stock
                    'min_sale_qty' => 1, //Minimum Qty Allowed in Shopping Cart
                    'max_sale_qty' => 2, //Maximum Qty Allowed in Shopping Cart
                    'is_in_stock' => 1, //Stock Availability
                    'qty' => 100 //qty
                    )
                );

            $product = $this->productRepository->save($_product);

            $id = $product->getId();

            return $id;


texts: How to get minimum, maximum, and available products for a product

texts: I need to find the stock details of a product how to find that.


texts: Getting the Products which have a specific product among the Up-Sells

texts:
How can I get the list of products which have a specific product among their Up-Sells?

To be more specific, I'm getting a list of products with a specific attribute; I need to remove those products from the Up-Sells list across all the products in the Database, so, I'd like to filter the collection in some way.

Magento CE 1.9


texts: How to get only configurable products as a bestseller in Magento 2?

texts:
My site contain only configurable products and I want to display bestseller products. I know there are many extension available for bestseller products but i want to display only configurable products.

Can anyone help me solve this.

Thanks In Advance.


texts: Magento 2: How can we get custom value from custom table in product grid

texts:
I have create custom module and render product grid with custom column "Store Price" and that value is saved in custom table with product id. Now I want to render store price in that coulmn.
Note: that custom column is rendered from "render" option with Block path in addcolumns.

Prepare columns:

    protected function _prepareColumns()
    {
        $this->addColumn(
            'entity_id',
            [
                'header' => __('Product Id'),
                'sortable' => true,
                'index' => 'entity_id',
                'header_css_class' => 'col-id',
                'column_css_class' => 'col-id'
            ]
        );
        $this->addColumn(
            'name',
            [
                'header' => __('Product Name'),
                'index' => 'name'
            ]
        );
        $this->addColumn(
            'sku',
            [
                'header' => __('Sku'),
                'index' => 'sku'
            ]
        );

        $this->addColumn(
            'price',
            [
                'header' => __('Price'),
                'index' => 'price'
            ]
        );

        $this->addColumn(
            'store_price',
            [
                'header' => __('Store Price'),
                'index' => 'entity_id',
                'renderer'  => '\Vendor\Modulename\Block\Adminhtml\Template\Renderer\StorePrice',
            ]
        );

        $this->addColumn(
            'product_id',
            [
                'header' => __('Select Product'),
                'sortable' => false,
                'type' => 'checkbox',
                'field_name' => 'product_id[]',
                'index' => 'entity_id',
                'header_css_class' => 'col-id',
                'column_css_class' => 'col-id'
            ]
        );

        return parent::_prepareColumns();

Render File:

namespace Vendor\Modulename\Block\Adminhtml\Template\Renderer;
use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer;
use Magento\Framework\DataObject;
use Magento\Store\Model\StoreManagerInterface;

class StorePrice extends AbstractRenderer
{
 private $_storeManager;
 /**
  * @param \Magento\Backend\Block\Context $context
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Context $context,   StoreManagerInterface $storemanager, array $data = [])
{
    $this->_storeManager = $storemanager;
    parent::__construct($context, $data);
    $this->_authorization = $context->getAuthorization();
}
/**
 * Renders grid column
 *
 * @param Object $row
 * @return  string
 */
public function render(DataObject $row)
{

    return '<input type="text" maxlength="10" name="product_price[]">';
}
}

Thanks in advanced


texts: Magento 1.9 - How to change product text field attribute backend_type from varchar to decimal?

texts:
I have customer attribute called carat as a type textfield and backend_type = varchar in my store.

I need to use this attribute in Advanced Search page as a range
attribute.
If I'll change backend_type = varchar to decimal from database directly then it works as range attribute. But I didn't get any result in search page.
I can not delete this attribute and and create new attribute because it's already used in api's and in some other functionality also.
How can I change attribute type and get store values as it is?


texts: Show Price Total of Wishlist Including Options and Quantities

texts:
I want to set my Magento wishlist page up to resemble a quote page.  In order to do that, I need to show the total of all the line items in the wishlist including the configured price and the quantities.  Right now, I am able to produce a Total but it does not include the product options, it only grabs the product base price.

  app/design/frontend/.../.../template/wishlist/item/list.phtml

<?php
    $columns = $this->getColumns();
    $wishlistTotal = 0;
?>

    <?php if (count($this->getItems())): ?>
        <?php foreach ($this->getItems() as $item): ?>
        <li class="item" id="item_<?php echo $item->getId();?>">
            <?php $i = 0; $count = count($columns);
            foreach ($columns as $column):
                $column->setItem($item);

                if ($i === 1) :
                    echo '
';
                endif;

                echo $column->toHtml($item);

                if (++$i === $count) :
                    echo '
';
                $_product = $item->getProduct();
        $options = false;
        if ($optionsBlock = $this->getChild('customer.wishlist.item.options')) {
            $options = $optionsBlock
                ->setItem($item)
                ->getConfiguredOptions();
        }
        $wishlistTotal = $wishlistTotal + ($_product->getPrice($_product, empty($options)) * $item->getQty());
        //echo $item->getPrice();

                endif;
            endforeach; ?>

        <?php endforeach ?>
    <?php else: ?>

<?php echo $this->__('This Wishlist has no Items');?>

    <?php endif; ?>
<?php
    echo '

';
    echo '
Wishlist Total: $' .number_format($wishlistTotal, 2, '.', ','). '
';
    echo '

';
?>

<?php foreach ($columns as $column): ?>
    <?php echo $column->getAdditionalHtml();?>
<?php endforeach; ?>

If there's an easier way to do this, please let me know.  Otherwise, I'd like help figuring out how to show the wishlist total including quantities and item total prices.  Thanks in advance!

Magento 1.9.1


texts:
i wanna to create Custom Theme without JS magento 2 default. When I enable the require-js functionality magento keeps loading all the default JS files. can you help me handle my problem?
thank you so much


texts: how many custom options a product can have

texts:
I am creating a configurable product, i need to add some 52 custom options to that product.

But i am unable to add 23rd option. 22 options and their values are created fine but as soon as I start to create 23rd custom option and save product. It gives message "The product is saved." but 23rd custom option is not there.

EDIT--

I have mix of text, area, checkboxes and radio buttons as product options. I can add text or area as another product option but cannot add another checkbox type. There are already 5 checkboxes types of product options


texts: Adding if statement to a core method in custom module

texts:
How do I add some functionality to a existing method?

I created a custom module now and need to add some code to Create.php file. This is the original:

public function initFromOrderItem(Mage_Sales_Model_Order_Item $orderItem, $qty = null)
    {
        if (!$orderItem->getId()) {
            return $this;
        }

        $product = Mage::getModel('catalog/product')
            ->setStoreId($this->getSession()->getStoreId())
            ->load($orderItem->getProductId());

        if ($product->getId()) {
            $product->setSkipCheckRequiredOption(true);
            $buyRequest = $orderItem->getBuyRequest();
            if (is_numeric($qty)) {
                $buyRequest->setQty($qty);
            }
            $item = $this->getQuote()->addProduct($product, $buyRequest);
            if (is_string($item)) {
                return $item;
            }

            if ($additionalOptions = $orderItem->getProductOptionByCode('additional_options')) {
                $item->addOption(new Varien_Object(
                    array(
                        'product' => $item->getProduct(),
                        'code' => 'additional_options',
                        'value' => serialize($additionalOptions)
                    )
                ));
            }

            Mage::dispatchEvent('sales_convert_order_item_to_quote_item', array(
                'order_item' => $orderItem,
                'quote_item' => $item
            ));
            return $item;
        }

        return $this;
    }

All I need to add is:

if (
    !$this->getSession()->getReordered()
    && $orderItem->getOriginalPrice() != $orderItem->getPrice()
) {
    $item->setCustomPrice($orderItem->getPrice());
    $item->setOriginalCustomPrice($orderItem->getPrice());
}

Above the line if ($additionalOptions = $orderItem->getProductOptionByCode(‘additional_options’)) {

How do I do it in my custom module:

<?php

class MyModule_CustomPriceRevert_Model_Sales_Order_Create extends Mage_Adminhtml_Model_Sales_Order_Create {

}


texts: Create customer group attribute in Magento 2

texts:
I have searched lots of links on google but can't find any relevant answer.
Can anybody help ? I want to create customer group attribute.


texts: Magento 1 + Turpentine versus Magento 2 + Varnish

texts:
I am using (Magento 1 + Nexcess Turpentine) combination for a long time with very good results. Now I am playing with Magento 2.2.0 and it has its own internal mechanism for doing the job with Varnish, but it is out of the box.

Comparing with the one in Magento 2, Nexcess Turpentine extension is a great tool for Magento 1, with lots of features and abilities to control the cache for almost everything you need. Is anyone who used Varnish with Magento 2 and can provide some feedback comparing to (Magento 1 + Turpentine)?


texts: Why does Magento Indexes Drop Table before Recreating Index? Any workaround?

texts:
Magento drops the index tables and then rebuilds them.

Meanwhile, clients dependent on those tables are out of service.

E.g., if the catalog_product_flat index becomes invalidated or is in the process of rebuilding your frontend will almost entirely cease to function.

Why not rebuild table catalog_product_flat_1 as temp_catalog_product_flat_1?

When it's rebuilt, drop the old catalog_product_flat_1 and rename the temp version.

With tens or hundreds of thousands of products it can take 10 minutes just to rebuild that one index. To reindex all tables it can take more than 30 minutes. Why not implement my idea?

Any ideas?


texts: Incorrect currency format in product and checkout pages

texts:
The store locale is bg_BG. After the product page is opened the price is rendered correctly formatted from the server.
When the following JS is executed the format is wrong.

<script>
    require([
        'jquery',
        'priceBox'
    ], function($){
        var dataPriceBoxSelector = '[data-role=priceBox]',
            dataProductIdSelector = '[data-product-id=1]',
            priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

        priceBoxes = priceBoxes.filter(function(index, elem){
            return !$(elem).find('.price-from').length;
        });

        priceBoxes.priceBox({'priceConfig': {"productId":"1","priceFormat":{"pattern":"%s\u00a0\u043b\u0432.","precision":2,"requiredPrecision":2,"decimalSymbol":",","groupSymbol":"\u00a0","groupLength":2,"integerRequired":false}}});
    });
</script>

I cannot find what is causing this issue and how to fix it. Any guidance would be really appreciated.

Examples:
Before JS:
1 199,00 лв.
155,00 лв.
after the JS:
11 99,00 лв.
1 55,00 лв.


texts: Magento 1.9 tax exemption for companies in the EU

texts:
A webstore located in Greece must follow the rules below for all products
a) All individuals with 24% VAT
b) All companies in Greece with 24% VAT
c) All the rest of companies in the EU with 0% VAT
d) Companies in the rest of the world with 24% VAT

All prices in products are included VAT
How can this be possible automated in the checkout page?

Thanks in advance


texts:
Im setting up a Magento Shop using PayPal for the first time.

Standard / Express PayPal Checkout works perfectly but only if the customer has a PayPal account. There should be a "guest checkout" option wich allows users to pay via Credit Card without creating a PayPal Account.

To activate this there should be a Checkbox inside the PayPal Configuration: "Enable PayPal Guest Checkout" but there isn't.

Im using Magento 1.9.2.2 (Community)

Is there anything I have to set up before this option shows up? Or did PayPal deactivate Guest Checkout to force users to PayPal Plus?

How it should be:

But I don't have this option:


texts: Magento 2 Product Grid is Rendering Special Characters as HTML Tags

texts:
For some reason my product grid in Magento ver. 2.3.4 (Open Source version) is rendering the special characters & and " as HTML tags.

For example creating a product with the name

Product name & Testing "Description"

It renders in the grid as:

Product name &amp; Testing &quot;Description&quot;

This seems to only occur in the product grid shown on the Admin pages. The product name characters display as they should on the front end of the site.

There don't seem to be any errors in the console and I've disabled the only extension which has a direct effect on the product grid which didn't change anything so I'm not sure what is causing it.

It also doesn't seem to be affecting any characters other that & and ". None of the other characters I enter seem to be affected by this.

Does anyone know how to fix this issue, or what might be causing it?

Thanks


texts: how long will the items stay in shopping cart for logged in customers?

texts:
Since so many customers added items in shopping cart but not checkout, the stock will be hold by this situation. How can i limit the time of items staying in customers's cart?

Setting Quote Lifetime setting->Checkout->Quote Lifetime (days) is a solution?


texts: How to remove selected payment method on page load

texts:
I need to remove selected payment method from local storage when page reload in magento2

If anyone knows, explain me ..

Thanks


texts: How to add additional options in order admin side in Magento 2.3?

texts:
I am sending additional custom options in the cart when add to cart a product.

I have used this link
. Using this link I have added custom options in the cart as well on checkout page and minicart. But custom options are not showing in admin.

I have tried link2, Link3,  link4 but still getting error on checkout page: {"message":"An error occurred on the server. Please try to place the order again."}

How can I show additional custom options on the order page in admin?