texts: Magento 2.3.4 - Best practice to do update magento files and modules without affect the website in Production Mode

texts:
If i update any modules or disable extensions my website showing an error message, i do following all the commands then coming back to normal,

rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/*

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy -f   // (-f for Development Mode)

php bin/magento cache:flush

Give permission

Time to complete a minimum of 5 minutes, during that time my website showing error message like

Permission related issue
Static files related issue

How to overcome this issue in the Production Mode?


texts: Magento 2.1.9 Back-end css not loading, the style sheet was not loaded because its MIME type, "text/html",

texts:
I m using Magento 2.1.9 for my application.Today I noticed that after passing commands like setup:upgrade css is not loading for back-end while works perfectly in front-end. I checked console and find there was an error and written as Refused to apply style because its MIME type ('text/html') is not a supported style sheet MIME type, and strict MIME checking is enabled.

Please help me to fix this error.


texts: Store selector (not switcher) inside phtml file

texts: Is there any method to call store selector inside phtml file? I found only store switcher but I need store selector multiselect options.


texts:
I try to add a new block in the category_view.xml for the footer sesion I don't see my new block any idea?

  <referenceContainer name="footer-container">
        <block class="Magento\Framework\View\Element\Template" template="category/banner_category_footer.phtml" name="banner_category_ptk"/>
    </referenceContainer>

Above code is placed in app/design/frontend/Special/cali/Magento_Catalog/layout/catalog_category_view.xml

and the file template is

app/design/frontend/Special/cali/Magento_Catalog/templates/category/banner_category_footer.phtml


texts: Add custom group_id to customers on upload

texts:
I'm trying to add 5000 customers using the csv uploader. I used the API to add all 5000 customer codes, but when I try to use the csv uploader, it says:

 Value for group_id attribute contains incorrect value, see acceptable values on settings specified for Admin

I've reindexed and cleared the cache, so why doesn't it recognize the names as valid? Do I have to download all of the data, and write a script to replace the company names with their id's?

Thanks


texts: Show Multiple Quantity + Product Price on Product Detail Page in Magento 2.3

texts:
How we can show quantity table + product prices as given below screenshot on product Detail Page. If someone have idea, Please guide me i want to implement like this. These prices should be change according to variations.

Thank you.


texts:
I am using Magento 1.9.3

I want to add a static block in invoice pdf. Can I load any static block?

If it is possible then how I can do this?


texts:
I've used Bodak Module :https://github.com/sbodak/magento2-checkout-custom-form

And I changed the checkout to my liking.

How can I add the spaces between the text "If you don't have the code, you can skip this step." and the textbox?

I tried with css but it also changes those above.

Thanks!


texts: Magento2: impossible run command in terminal setup:di:compile

texts:
Impossible run command: php bin/magento setup:di:compile

return error:

[@s1 public_html]$ php bin/magento setup:di:compile
PHP Fatal error:  Uncaught Error: Cannot use object of type __PHP_Incomplete_Cla                        ss as array in /home/czasowe/domains/mywebsite.com/public_html/vendor/mag                        ento/framework/ObjectManager/Factory/AbstractFactory.php:130
Stack trace:
#0 /home/czasowe/domains/mywebsite.com/public_html/vendor/magento/framewo                        rk/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManag                        er\Factory\AbstractFactory->resolveArgument(Object(__PHP_Incomplete_Class), 'Sym                        fony\\Compone...', NULL, 'output', 'Magento\\Setup\\M...')
#1 /home/czasowe/domains/mywebsite.com/public_html/vendor/magento/framewo                        rk/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectMana                        ger\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Setup\\M...', A                        rray, Array)
#2 /home/czasowe/domains/mywebsite.com/public_html/vendor/magento/framewo                        rk/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectMana                        ger\Factory\Dynamic\Developer->_resolveArguments('Magento\\Setup\\M...', Array,                         Array)
#3 /home/ in /home/czasowe/domains/mywebsite.com/public_html/vendor/magen                        to/framework/ObjectManager/Factory/AbstractFactory.php on line 130

Fatal error: Uncaught Error: Cannot use object of type __PHP_Incomplete_Class as                         array in /home/czasowe/domains/mywebsite.com/public_html/vendor/magento/                        framework/ObjectManager/Factory/AbstractFactory.php:130
Stack trace:
#0 /home/czasowe/domains/mywebsite.com/public_html/vendor/magento/framewo                        rk/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManag                        er\Factory\AbstractFactory->resolveArgument(Object(__PHP_Incomplete_Class), 'Sym                        fony\\Compone...', NULL, 'output', 'Magento\\Setup\\M...')
#1 /home/czasowe/domains/mywebsite.com/public_html/vendor/magento/framewo                        rk/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectMana                        ger\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Setup\\M...', A                        rray, Array)
#2 /home/czasowe/domains/mywebsite.com/public_html/vendor/magento/framewo                        rk/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectMana                        ger\Factory\Dynamic\Developer->_resolveArguments('Magento\\Setup\\M...', Array,                         Array)
#3 /home/ in /home/czasowe/domains/mywebsite.com/public_html/vendor/magen                        to/framework/ObjectManager/Factory/AbstractFactory.php on line 130
[@s1 public_html]$

Anyone know how to solve?


texts:
I created a new module softcopy. and also created a new table with six fields of name softcopy_softcopy.

I am trying to access the table so that I can add a new row with some data which I have in controller.

So, I tried the below code in softcopy controller:

echo Mage::getResourceModel('catalog/product_collection')->getTable('softcopy/softcopy');

I got the following error in var/report:

  a:5:{i:0;s:47:"Can't retrieve entity config: softcopy/softcopy";i:1;s:1469:"#0

How should I access my newly created table in my controller?

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Efk_Softcopy>
            <version>1.0</version>
        </Efk_Softcopy>
    </modules>
    <frontend>
        <routers>
            <Efk_Softcopy>
                <use>standard</use>
                <args>
                    <module>Efk_Softcopy</module>
                    <frontName>softcopy</frontName>
                </args>
            </Efk_Softcopy>
        </routers>
    </frontend>
    <global>
        <models>
            <softcopy>
                <class>Efk_Softcopy_Model</class>
            </softcopy>
        </models>
        <blocks>
            <softcopy>
                <class>Efk_Softcopy_Block</class>
            </softcopy>
        </blocks>
    </global>
</config>


texts: Magento 2: How to secure AJAX request from hacking?

texts:
How to secure jQuery AJAX request on Client & Server side?

So there will be minimum risk of hack.

On server side we can use https


texts: How to achieve inheritance in Knockout JS implementation of Magento 2?

texts:
I have created one component 'measure_parent' and added one observable variable inside this.

this.width = ko.observable(false);

Now, I have extended this measure component inside another component 'measure_child'.

return measure_parent.extend({
        initialize: function () {

            this._super();
        },

I have attached measure_parent component to one html block

<div data-bind="scope:'measure_parent">

now, when I am trying to update the value of "width" from the "measure_parent" component then binding is working fine. However, when I am updating "width" from "measure_child" component binding is not working and only width variable is getting updated.
Please note that replacing "measure_parent" with "measure_child" in data-bind scope is working fine, however as there will be many children components of measure_parent therefore, this approach is not useful in my case.


texts:
I am new to magento. Trying to create my own theme. I have gone through the designers guide.

I created a folder example inside base folder as shown below:

app --> design --> frontend --> base --> default --> example

In the "example" folder, I added the following directory structure:

example --> layout --> page.xml
        --> template  --> page --> html --> footer.phtml

page.xml

<?xml version="1.0" encoding="utf-8" ?>
<default>
    <block type="page/html" name="root">
        <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml"/>
    </block>
</default>

footer.phtml

hello

I added the above theme to my frontend page through admin panel something like this:

admin panel --> system --> design --> Add design change --> store         =  "english"
                                                            custom design =  "example"

When I refreshed my frontend page, it is blank instead of showing "hello" text. Can someone highlight what step I am missing to consider?


texts: Magento 2: Order conformation mail is not sending?

texts: In my project, when a user creates an account they get the mail. But after making an order neither the customer nor the admin gets the mail. I found many solutions but that's all for Magento 1.9 or below. I am using Magento 2. I need a solution with or without using cron job. Can anyone help?


texts: Getting error in Rest Api guest-cart. [POST] V1/guest-carts/{cart-id}/items

texts:
1.Created a guest cart (this will give me the cartID)-> POST: http://.../Magento2/index.php/rest/V1/guest-carts

Get cart details-> GET: http://.../Magento2/index.php/rest/V1/guest-carts/{cartID}.
add items to cart-> POST: http://.../Magento2/index.php/rest/V1/guest-carts/{cartID}/items

Added in body part.
{
  "cartItem": {
    "item_id": 0,
    "sku": "string",
    "qty": 0
 }
}

Getting Error :-
{
  "message": "No such entity with %fieldName = %fieldValue",
  "parameters": {
    "fieldName": "cartId",
    "fieldValue": null
  },

Thanks in advance.

For ref. Testing in postman client & using  http://devdocs.magento.com/swagger/index.html#/ link.


texts:
I have been using magmi to import products in bulk, but now need to delete some of them.

How can I do this?


texts: Passing magento username and email variables into js script (Magento ver. 2.1.8)

texts:
I would like to pass User's first name and email into my js chat script. I know that I should be able to grab the customer session using the object manager like so:

<?php
    $customerSession = $om->get('Magento\Customer\Model\Session');
    if($customerSession->isLoggedIn()) {
        echo   $customerSession->getCustomer()->getId()."
";  // get Customer Id
        echo   $customerSession->getCustomer()->getName()."
";  // get  Full Name
        echo   $customerSession->getCustomer()->getEmail()."
"; // get Email Name
      }
?>

Would I pass the two variables by just echo'ing them out inside the quotations?


texts: Error : Cache frontend 'default' is not recognized after upgrade Magento version in 2.2.5

texts:
When I ran Setup:upgrade command then below error showing
InvalidArgumentException: Cache frontend 'default' is not recognized. in /vendor/magento/framework/App/Cache/Frontend/Pool.php:150 Stack trace: #0

What is solution?


texts: Invalid Argument Supplied for foreach() in /.../Importblock.php on Line 67

texts:
I am using a theme and trying to import blocks has this warning popup:

  Warning: Invalid argument supplied for foreach() in /home/pluslivi/public_html/app/code/Rokanthemes/RokanBase/Controller/Adminhtml/Rokanbase/Importblock.php on line 67

When I go to the file to take a look at the error line -

foreach($data['root']['blocks']['item'] as $_item) {
            $exist = false;
            $collection = $this->_objectManager->create('Magento\Cms\Model\Block')->getCollection();
            $collection->addFieldToFilter('identifier', $_item['identifier']);
            if($collection->getSize())
                $exist = true;
            $block = $this->_objectManager->create('Magento\Cms\Model\Block');
            if($overwrite) {
                if($exist) {
                    $conflictingOldItems[] = $_item['identifier'];
                    $block->load($_item['identifier']);
                }
            } else {
                if($exist) {
                    continue;
                }
            }
            $conflictingOldItems[] = $_item['identifier'];
            $_item['store_id'] = array(0);
            $block->addData($_item)->save();
            $i++;
        }

Can someone help me out with this?
Any help would be greatly appreciated.


texts:
In reading the documentation for the Magento migration tool I see that it is in multiple parts with separate commands. I've already created the settings manually in my new M2 store. I just want the data(products, attributes, etc...)

Can I run the data migration on its own so I'm just moving product data?


texts:
I am trying to remove the customs options from the item car with this code.

public function beforeupdateItems(\Magento\Checkout\Model\Cart $subject,$data){

    foreach ($data as $itemId => $itemInfo) {
    $item = $subject->getQuote()->getItemById($itemId);
    $optionIds = $item->getOptionByCode('option_ids');

                if ($optionIds) {
                    foreach (explode(',', $optionIds->getValue()) as $optionId) {

                        $item->removeOption('option_' . $optionId);
                    }
                    $item->removeOption('option_ids');
                }

                $item->save();
    }

return [$data];
}

I want to remove the custom options for the products that are in the cart. And add the news selected.

When I edit a product from the route localhost/checkout/cart/ Magento go to localhost/checkout/cart/configure/id/[number_quote]/product_id/[number_product]/ and render this:

If you pulse on "update button" then Magento remove all the options and add the new selected.

I want to know how Magento do this process.

I think that if in the checkout/cart "Shopping Cart" when I submit on "updating shopping cart button" if I created a module with one plugin. In this plugin I can to execute the code to remove the custom options and add the news selected.

Then I use "beforeUpdateItems" to execute the code,

But when I go back to the Shopping Cart the options continue in the products.

Thanks for your help!

[***** SOLUTION *****]

Hi everybody I found the solution. In the code change $item->save(); to:

  $item->saveItemOptions();

Regards!!


texts: How to solve "One or more indexers are invalid. Make sure your Magento cron job is running"

texts: My magento 2.2.1 website backend prompts "One or more indexers are invalid. Make sure your Magento cron job is running." How to solve this kind of error? Does it have a big impact?


texts:
To give a little context, we are using the OrganicInternet Simple Configurable Products module to avoid having configurable products in our cart. All simple products on the site are marked as not visible individually. The problem we have is that a simple product remains in the cart even when it's associated configurable is disabled or removed.

The quote_item for the simple product contains the ID of the configurable product that was added, so the obvious solution to this seems to be to hook into an event use the cpid to check if the configurable product is enabled and remove the item from the quote.

The only problem is, I'm not entirely sure where to hook into. I tried _before_save on the quote, this seems to work, but has the issue that if no items are left in the quote, you end up seeing an empty basket (as opposed to the empty basket message). Any suggestions?


texts: Magento 2 - changing the Qty does not update the displayed price on product page

texts:
I just started with Magento 2. I created a configurable product with two special dropdowns.

If I change the Qty, then the price does not update. It just shows 4,61 € all the time, no mather what I enter in the Qty field. Is this a bug or standard magento 2 behaviour? And why is there 0,00€ at the top? How can I fix it?

I am using the default Magento 2 Design "Luma"

Cart:


texts: Getting EAV setup to not recreate existing attribute options

texts:
Currently I have something similar to the following that creates attributes :

// $this->_catalogSetup -> Mage_Catalog_Model_Resource_Setup
$this->_catalogSetup->addAttribute(
    Mage_Catalog_Model_Product::ENTITY,
    'my_attribute_code',
    array(
        'type' => 'int',
        'filterable' => true,
        'label' => 'My Attribute',
        'input' => 'select',
        'option' => array('values' => array(
             'My Option 1',
             'My Option 2'
        )),
        'required' => false,
        'sort_order' => 1,
    )
);

However, obviously every time I run this, it create those options again.  I would like this code to be executed multiple times and only ever do an "update". This works fine for the rest of the attribute's details with the exception of the options, is there a way to make it update the options, rather than add to?


texts: Magento 2.2x Multiple Product Pricing/Quantity

texts:
I am building a website for a client that has multiple brick-and-mortar locations and I need to set up products with different prices (both retail and MAP) and quantities for each product based on the location a customer picks from the Magento site. I'm looking for advice on the best way to set this up.

For example, I have 10 physical stores that sell the same 100 products, but each product has its own pricing and quantities. I want the customer to pick a store and have Magento use the information for that store. I have the pricing and quantity information stored in a separate CSV file.

I don't know if there's an existing module someone has already created to do this, if I need to set up separate Magento stores (one for each physical store), or if I need to have something custom written.


texts:
I just want clear this out. I am still a newbie in Magento and this give me a hard time debugging it.

Scenario:
1. I add a product on my cart - good
2. I click the Homepage which open into a new Tab.
3. I add the same product
4. I got "Internal Server Error"

I can't add the same product if the cart page is open on the other tab.
Is this something to to with the Session on the Site? What could be the Possible Solution for This?

****Correct Scenario: The product number should increase and the price****


texts:
I have installed SUPEE 10266 patch one of Magento 1.7 site but MageReport still showing not patched. What could be the causes. I have also followed below link :

https://magentary.com/kb/install-supee-10266-without-ssh/

This link shows that we need to flush opcode cache or restart web server. I just disabled the opcache but still not working. Can anyone tell me what should I need to do to solve this problem.


texts: Lineup google_translate_element inline with label in Magento 1.6.2.0

texts:
In My Magento frontend page http://nilandsplace.com the Google Website Translator box drops below the label for it and below the header-container bar. I would like it to be like this

  Translate This Page:

Rather then

  Translate This Page:

The Dynamic code that comes from Google, in Firebug has
 tags that I found in Firebug would line up if I changed them to , but then this is after the page load and I can't figure out how to line things up before the page load. I can override the .goog-te-gadget {... with CSS but I can't find a way to override the  tag.
The dynamic code comes like this:

<select class="goog-te-combo">

  Powered by

I can't seem to find a CSS to do it, but then I am just learning. I have tried putting  tags in the above code but could not get it to load the gadget. I have been looking at the API for this, but it is way above my skill level. I am a cheap bastard and don't want to pay for an API I don't know how to use or hire a programmer and not know how to fix it when it breaks and it is easy to break Magento. Why I am still on 1.6.2.0. Just to scared to try a new one. I depend on the kindness and grace of others to lean what I need to know!


texts: How to get rid of cart empty problem during back button press?

texts:
During payment process in checkout section when to click back button the cart getting empty. How can I resolve this?
I want to maintain the cart items until the payment is a success.


texts: After the site has been properly working for awhile (year or so)... we get 403 Forbidden errors on CSS files hosted locally on the server. Changing permissions on the directories and files didn't work. This wasn't happening before. Any possible causes you guys can think of? The only change we made were some m2epro listings as well as adding considerable html to our descriptions, which still posed no issues for several days.


texts: My extension links not showing on custom roles on admin

texts:
I have created a custom module. When I have created a demo user and select custom roles for that. My module not showing on the admin side. When I select all the rights it's showing but when I select all/Some of the roles by selection than it's not showing on the admin side.
My menu code is like below:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
    <menu>
        <add id="Example_Abc::elements" title="EWD FAQ" module="Example_Abc"  sortOrder="60"  resource="Example_Abc::elements"/>
        <add id="Example_Abc::faq" title="Manage FAQs" module="Example_Abc" parent="Example_Abc::elements" sortOrder="61" action="example_abc/faq" resource="Example_Abc::faq"/>
        <add id="Example_Abc::category" title="Manage Categories" module="Example_Abc" parent="Example_Abc::elements" sortOrder="62" action="example_bc/category" resource="Example_Abc::category"/>
    </menu>
</config>

ACL.XML file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Example_Abc::faqs" title="FAQs">
                    <resource id="Example_Abc::faq" title="FAQs Manager">
                        <resource id="Example_Abc::faq_create" title="Create"/>
                        <resource id="Example_Abc::faq_edit" title="Edit" />
                        <resource id="Example_Abc::faq_delete" title="Delete"/>
                    </resource>
                    <resource id="Example_Abc::category" title="Categories Manager">
                        <resource id="Example_Abc::category_create" title="Create"/>
                        <resource id="Example_Abc::category_edit" title="Edit" />
                        <resource id="Example_Abc::category_delete" title="Delete"/>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>


texts: Magento 2: Translation in JavaScript don't work

texts:
I try to translate the next line and this don't show changes:

if (pending > 0) {
    $('#wrapper-freeshipping_alert > p').text($.mage.__('You need %1 more for free shipping').replace('%1', priceUtils.formatPrice(pending, quote.getPriceFormat())));
    $('#wrapper-freeshipping_alert').fadeIn();
}

In the same extension i have the next files with the translation:

en_US.csv:

  "You need %1 more for free shipping","You need %1 more for free shipping"

es_ES.csv:

  "You need %1 more for free shipping","Te faltan %1 para portes gratuitos"


texts:
I understand the concept of Marketplace as a website where customers can place orders from multiple Vendors, based on vendor score or reputation.

What if I don't want a real marketplace website but -

I should be able to manage vendors in back end.
In Magento backend, I should be able to assign the order to the vendor I find appropriate based on customer's location.
The vendor can ship the products ordered and mark the order as complete/closed after shipping is done.

Is any extension available for this or I have to combine some extensions for this purpose?


texts: How to override community class in local module

texts:
Basically there is a method in a core class that I need to override or rewrite. The problem is an existing community method is overwriting this same method and is eventually calling

return parent::method();

So it is still using its parent's method. How can I create a new class that overrides the PARENT method leaving the existing child alone. What would the php file look like?


texts: NotNull not working with AddFieldToFilter in Magento 2

texts:
I have following code to filter out rows on a column that is null and it is working

->addFieldToFilter(
            'ep_image',
            ['null' => true]
       )

and I have another code to filter out rows on a column that is not null which is not working

->addFieldToFilter(
            'ep_image',
            ['notnull' => true]
       )

Can anyone help me out on how to filter not null values?

Also tried array('notnull' => true)and array('null' => false), but none working.


texts:
I have a domain myxyz.com (+hosting) purchased from and set up in hosting site A.

My magento installation is on hosting site B.

How can I link this domain to the magento-website such that when someone hits my url myxyz.com (which is on site A), it opens up the magento store front (hosted on site B)?

Note: I want the url myxyz.com to redirect to my magento based website (which is also myxyz.com)


texts: How to add signout link after the minicart in magento2?

texts: Hello I want to add only signout link after the minicart in magento2...currently it is showing in drop down but i want to add sign out link after the minicart if customer is logged in how can i achieve this?


texts: Magento2: I need to get order Purchase Order Date and Purchased From fields in observer

texts:
I need to get order Purchase Order Date and Purchased From fields in the observer.

Here is my code:

namespace Abc\Mkt\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class SalesOrderSaveAfter implements ObserverInterface {
    protected $scopeConfig;
    protected $date;
    public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Abc\Mkt\Model\Orderapi $orderData)
   {
      $this->scopeConfig = $scopeConfig;
      $this->date = $date;
      $this->orderData = $orderData;
   }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $enable=$this->scopeConfig->getValue('abc_mkt/orderconfig/mkt_order_integration', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
        if($enable){
            $order = $observer->getEvent()->getOrder();
            $status = 0;
            $name='';
            $data['Email'] = $order->getCustomerEmail();
            $data['FirstName'] = $order->getCustomerFirstname();
            $data['LastName'] = $order->getCustomerLastName();
            $response= $this->orderData->orderData($data,$status,$name);
            $res= json_decode($response, true);
            if($res['success']==1){

                $status = 1;
                $oname= $orderobjectname;

                $tdiscount = explode('-', $order["base_discount_amount"]);
                $couponApplied = $order->getCouponCode();
                $odata['orderId']= $order->getIncrementId();
                $odata['emailAddress'] = $order->getCustomerEmail();
                $odata['totalOrderAmount'] = $order->getGrandTotal();
                $odata['shippingCostInOrder'] =$order["shipping_amount"];
                $odata['totalQuantity'] = $order["total_qty_ordered"];
                $purchasedOrderDate = $order->getCreatedAt();
                $odata['purchaseOrderDate'] = $purchasedOrderDate;

                $billingObj = $order->getBillingAddress();
                $billStreet = $billingObj->getStreet();
                if(isset($billStreet[1])){ $billStreetComplete =  $billStreet[0].' '.$billStreet[1]; } else { $billStreetComplete = $billStreet[0]; }
                $odata['billingDetails'] =  trim($billingObj->getCompany()).','.$billStreetComplete.','.$billingObj->getRegion().','.$billingObj->getCity().','.$billingObj->getPostcode().';'.'T: '.$billingObj->getTelephone();

                $shippingObj = $order->getShippingAddress();
                if(!empty($shippingObj)){
                    $shipStreet = $shippingObj->getStreet();
                    if(isset($shipStreet[1])){ $shipStreetComplete =  $shipStreet[0].' '.$shipStreet[1]; } else { $shipStreetComplete = $shipStreet[0]; }
                    $odata['shippingDetails'] = trim($shippingObj->getCompany()).','.$shipStreetComplete.','.$shippingObj->getRegion().','.$shippingObj->getCity().','.$shippingObj->getPostcode().';'.'T: '.$shippingObj->getTelephone();
                }

                $odata['couponApplied'] = $couponApplied ;
                if($order["tax"]){
                            $odata['taxInOrder'] =$order["tax"] ;
                } else {
                    $odata['taxInOrder'] =0.00 ;
                }
                if($order->getBaseDiscountAmount()){
                    $tdiscount = explode('-', $order->getBaseDiscountAmount());
                    if($tdiscount){
                        $odata['totalOrderDiscount'] = $tdiscount[1];
                    }else{
                        $odata['totalOrderDiscount'] = 0.00;

                    }
                }else{
                    $odata['totalOrderDiscount'] = 0.00;
                }

                $response= $this->orderData->orderData($odata,$status,$oname);
            }
        }
        return $this;
    }
}

Anyone have a solution for this?

Thanks


texts: Fetch all orders from a particular orderid

texts:
I want all orders from a particular orderId.

  <?php
    namespace Racom\Chatbotapi\Model;

    use Racom\Chatbotapi\Api\ChatbotapiInterface;

    class Chatbotapi implements ChatbotapiInterface
    {
        protected $order;

        public function __construct(
            \Magento\Sales\Model\Order $order
        ) {
            $this->order = $order;
        }

        /**
         * Returns the Orders list.
         *
         * @api
         * @param Integer $orderId order Id.
         * @return string Greeting message with users name.
         */
        public function getOrder($orderId)
        {
            $productCollection = $this->order->load($orderId);

            $a = $productCollection->getItems();

            $v = json_encode($a);

            return $v;
        }
    }


texts: Magento Update & Local Host to Live Server

texts:
I have been working on a Magento site remotely that is now ready to go 'live' (it was worked on remotely as to not make any changes to the live site until it's ready).

I plan on putting all the 'app' / 'media' / 'skin' etc folders back onto the server with the new changes, and will make all the backend changes manually as I want to keep the recent orders and database that has been created.

However I would like to do the update to Magento before doing so. I know that Magento updates often overwrite the 'Core' files. If i'm replacing these with those that I have externally anyway, will it matter? I guess my concern is that the files I upload won't now be compatible with the update that I plan to do.


texts:
Why is it that when I enable error messages using these instructions: https://www.templatemonster.com/help/magento-how-to-display-error-messages.html

That my site completely stops work?  Before, my homepage worked fine.  But when I change index.php as the article suggests, I just get this error message on my home page:

Warning: fopen(/git/magento/var/locks/index_process_4.lock): failed to open stream: Permission denied  in /git/magento/app/code/core/Mage/Index/Model/Process.php on line 423

Why would it start failing all of a sudden?  Does enabling error messages somehow cause warnings to become errors?

Thank you for your help.

EDIT:

The real question here is why does enabling error messages turn the warnings into errors? That's why I don't believe this question is a duplicate at all.


texts: Hello I have created one custom attribute "Brand" with select box and add lots of brand for product. Now I want to display brand value with alphabets order in cms page.


texts:
In my module i am create one system configuration now i want to add that link in menu i am trying this code:

in acl.xml

<resource id="Training_Test::example" title="Example" sortOrder="60">
     <resource id="Training_Test::settings" title="Settings" sortOrder="20" />
</resource>

in add this code menu.xml

<add id="Training_Test::settings" title="Settings" module="Training_Test" sortOrder="30" resource="Training_Test::settings" action="admin/system_config/edit/section/example" parent="Training_Test::example"/>

but using this code its redirect to dashboard

Other link in menu it works fine but configuration link is not working

[EDIT]

When i disable Configuration > admin > security > Add secret key in Urls than it works fine but i dont want to disable Add secret key in Urls.

is there any thing to add for this?


texts: Unable to add price during adding product 2.0.2

texts:
Here is my partial code

    $productObj = $objectManager->create('Magento\Catalog\Model\Product');
        $totalAdded ++;
        $productObj->setName($value->product_name) // Use default
        // ->setStoreId(39)
           ->setPrice(100.99)
            // price in form 100.99

        ->setAttributeSetId(9) //ID of a attribute set named 'default'
        ->setStatus($var_val->status)
        ->setVisibility(4)
        ->setStoreId($storeId)
        ->setWebsiteIds(array($websiteId))
        ->setDescription($value->description)

        //->setSpecialPrice($var_val->min_price) //special price in form 11.22
        ->setSku($var_val->sku."-".$var_val->variant_id) //SKU
      ->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' => $var_val->quantity //qty
        ))

        ->setColor($var_val->color)
        ->setWeight($var_val->weight);

after adding product price is not getting stored in backend and showing 0 in frontend.


texts: Magento2 How to get customer billing agreement by entity_id

texts: How to get customer billing agreement data. I can't find a table in the database. can someone guide me to get data or query?


texts: Override default CreateController in side MyModule in Magento

texts:
I need to Override
Mage/Adminhtml/controllers/Sales/Order/CreateController.php

Step 1:-  I write in etc/config.xml

<admin>
   <routers>
       <adminhtml>
           <args>
               <modules>
                   <Mycompany_Mymodule before="Mage_Adminhtml">Mycompany_Mymodule_Adminhtml</Mycompany_Mymodule>
               </modules>
           </args>
       </adminhtml>
   </routers>

Step 2:- I put CreateController.php file on this location
/var/www/magento/app/code/community/Mycompany/Mymodule/controllers/Adminhtml/Sales/Order

Step 3: I did changes in controller class name

class Mycompany_Mymodule_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Sales_Order_CreateController
{ }

I am unable to override by this implementation. Please, Help me to override this controller.


texts: Google Base not working in Magento 1.5.1.0

texts:
I have integrated google base in my site. I gave google merchant
   details (username and password) in " configuration -> sales > Google
   API" in that google base tab.

And then i go to " catalog -> google base -> manage attributes" then
   click the ' add attribute mapping' button in the right side of the
   page. i got error message like

   '`Read timed out after 10 seconds`'

I increased timeout seconds upto 360 also . it wont work. what is the
   problem?.  As for my surfing i have 85000+ products in my store. That
   is the reason for the problem to google base throws error?.

Kindly Advice.


texts: Magento2: 404 Not found when calling a frontend controller

texts:
I know that there are similar questions to this but none of the other questions fix my problem.
I'm still doing Magento training and I'm practicing to create a frontend controller that renders "HELLO WORLD" (module name: Unit2_HelloWorldController)
What I have created:

Declare a route in Unit2/HelloWorldController/etc/frontend/routes.xml

<?xml version="1.0"?>
<!--
    /**
    * Copyright © Magento. All rights reserved.
    * See COPYING.txt for license details.
    */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="helloworldcontroller" frontName="helloworldcontroller">
            <module name="Unit2_HelloWorldController" />
        </route>
    </router>
</config>

Create an action class in HelloWorldController/Controller/index.php

<?php
/**
*
* Copyright © Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Unit2\HelloWorldController\Controller\Action;
/**
* Class Index
* @package Unit2\HelloWorldController\Controller\Action
*/
class Index extends \Magento\Framework\App\Action\Action {
    /**
    * @var \Magento\Framework\View\Result\PageFactory
    */
    protected $_pageFactory;
    /**
    * Index constructor.
    * @param \Magento\Framework\App\Action\Context $context
    * @param \Magento\Framework\View\Result\PageFactory $pageFactory
    */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory
    )
    {
        $this->_pageFactory = $pageFactory;
        return parent::__construct($context);
    }
    /**
    * @return \Magento\Framework\Controller\ResultInterface
    */public function execute()
    {
        $result = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_RAW);
        $result->setContents('Hello World');
        return $result;
    }
}

Create HelloWorldController/registration.php

<?php
/**
*
* Copyright © Magento. All rights reserved. * See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Unit2_HelloWorldController',
    __DIR__
);

Create HelloWorldController/etc/module.xml

<?xml version="1.0"?>
<!--/** * * Copyright © Magento. All rights reserved. * See COPYING.txt for license details. */--><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Unit2_HelloWorldController" setup_version="0.0.1"></module>
</config>

Then I ran these commands
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

and when I try to open http://localhost:8080/magento2/helloworldcontroller/action/index I got 404 Not Found.
What am I doing wrong here? Any helps would be appreciated. Thank you.


texts:
Here is my code:

class Dolphin_Slideshow_Block_Adminhtml_Slideshow_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
    public function __construct()
    {
        parent::__construct();
        $this->setId('slideshowGrid');
        $this->setDefaultSort('slideshow_id');

        $this->setDefaultDir('ASC');
        $this->setSaveParametersInSession(true);
        $this->setUseAjax(true);
    }
}

getGridUrl() function in grid.php:

public function getGridUrl()
{
    return $this->getUrl('*/*/grid', array('_current'=>true));
}

gridAction() function in controller:

public function gridAction()
{
    $this->loadLayout();
    $this->getResponse()->setBody(
        $this->getLayout()->createBlock('slideshow/adminhtml_slideshow_grid')->toHtml()
    );
}

Updates:
Now, after so many try...i found if i removed foreach loop from preparecollection method then My Sorting is working....but after doing this....All store views title are not fetch into admin grid .. but there is no problem with english, french


texts: non Magento PHP classes can't be instantiated inside Magento 2 Helper or or Controller or Models

texts:
Questions

What is the BEST way to instantiate such 3rd party non Magento classes in Magento 2?
What is the BEST way to connect to MS SQL server to run a query? I am
using PDO.

Issues

I am not able to instantiate any core PHP classes or custom classes inside the helper / module files of Magento 2. I have tried the following but nothing worked.

$connection = new PDO('dblib:host='.$host.';dbname='.$dbname.';charset=utf8', $username, $password);

I had also tried to do the same for PHPExcel code as well, I had kept PHPExcel code inside lib folder and tried to use it

require_once BP.'/lib/internal/PHPExcel/PHPExcel/IOFactory.php';
PHPExcel_IOFactory::createReader($inputFileType);

None of the above worked and Magento is always trying to look for these classes under its name spaces and auto loading process.

Error Details

  Fatal error: Uncaught Error: Class 'Datamart\M3Connector\Helper\PDO' not found in web/app/code/Datamart/M3Connector/Helper/M3MsSqlDb.php:19 Stack trace: #0 web/app/code/Datamart/CustomerOrders/Controller/UploadOrder/Index.php(30): Datamart\M3Connector\Helper\M3MsSqlDb->getConnection() #1 web/var/generation/Datamart/CustomerOrders/Controller/UploadOrder/Index/Interceptor.php(24): Datamart\CustomerOrders\Controller\UploadOrder\Index->execute() #2 web/vendor/magento/framework/App/Action/Action.php(102): Datamart\CustomerOrders\Controller\UploadOrder\Index\Interceptor->execute() #3 [internal function]: Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #4 web/vendor/magento/framework/Interception/ in web/app/code/Datamart/M3Connector/Helper/M3MsSqlDb.php on line 19


texts:
Hello i have problem with loading pending orders from backend
Im pressing view button and it trying to load the page but after a while i get 500 internal server error  any suggest??


texts: Magento 2. Issue with correct setup of stores (nginx)

texts:
I have three stores:
http://www.nl.mysite.nl
http://www.gb.mysite.nl
http://www.us.mysite.nl

As soon as i type them they all redirect to the default website: http://www.mysite.nl/default

When i type the code of the respective stores after http://www.mysite.nl/ i am redirected to the store in question; for instance, by typing http://www.mysite.nl/nl_store i am redirected to http://www.nl.mysite.nl/nl_store

Any ideas on how to fix this, in a way that the three stores do not redirect to the default, but to the themselves?

I would really appreciate your help.


texts: Creating Coupon For First Two Products Free

texts:
I have a category "Free Samples" and want the first 2 products in that category to be free and the rest to cost their original price.
So lets say the user adds these products to their cart:
sample1 - $8.00
sample2 - $8.00
sample3 - $8.00

sample1 and sample2 should be free and sample3 should $8.00
with the cart total being $8.
How can I do this using the Promotions->Shopping Cart Price Rules?


texts:
I need to trigger transaction decline or any other failed payments in my sandbox but I'm enable to do so.
I've used this details ref:https://developers.braintreepayments.com/reference/general/testing/ruby#test-value-4000111111111115
more specifically : 4000111111111115
But still process the payment and no error transaction declined message.
Any suggestion please!


texts: How to Active second tab on product detail page when product detail page is opened?

texts: How to active 2nd tab name 'More Information' in product view page on page load.


texts:
Magento provides facility to specify different locale for each store view from the backend.

My question is, if i assign locale Persian, Urdu or anything (RTL Locale). Does that add dir='RTL' to HTML tag? Or How should i add dir="RTL" attribute to HTML tag for specific locale ? Do i need to customize magento for this ?


texts:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head>
    <script src="https://www.gstatic.com/firebasejs/7.18.0/firebase-app.js" src_type="url"/>
    <script src="https://www.gstatic.com/firebasejs/7.18.0/firebase-messaging.js" src_type="url"/> </head> </page>


texts: Copy a Widget Instance Programmatically, Preserving Layout Updates

texts:
I try to copy a widget instance.

The following function is run from a console script (shell/), adminhtml Events are initialized.

The problem: What I get from the $orig->getData('page_groups') differs from the array format Magento uses when submitting the backend edit page for a widget instance (CMS -> Instances).

I will post an answer, but I am happy if somebody finds a better solution.


texts: Images not uploading when going through the process in the Product Images tab

texts:
Magento 1.9.1
Porto theme

There is a problem in the Product images tab in this version of Magento, where if the anti-virus software/firewall/Windows/browser security disables Javascript - it makes the upload images buttons disappear. This happens periodically when there is some kind of a security update that comes through. Do you know what we need to disable in order to make these buttons come back?

The other more important issue is - we actually can see and use the upload image buttons on one computer, however, when we do - we go through the motions but the image does not actually upload! What could be causing this type of an issue? I've already made a ticket with the hosting company about this as they change settings on our VPS server every once in a while but their level 1 support usually brushes me off. What would be the best things to check in order to troubleshoot this?

Updated: I have Google Chrome Version 66.0.3359.181 (Official Build) (64-bit), I have the Javascript ENABLED and the buttons still do not show. Still though - the more important issue for us is that on the machine where we actually have the buttons and go through the steps - the image does not actually upload.


texts: Order notes being populated by previous orders

texts:
In our Magento 1.7.0.2 store we have noticed a few orders where backend notes from the same customer's previous orders are being populated for their new orders.

This is only happening for customers who have previously created a customer account when placing an order, and are logging in to make subsequent orders through the same customer account.

The issue is summarised as follows:

Customer places an order (order A) and creates a customer account
Admin adds notes to the order (held in customer_note field)
At some point in the future, customer logs back in to place another order (order B)
Notes from order A are automatically appearing for order B

The notes I am referring to have originally been added via the comments box at the bottom of the order management page eg:

The information is being automatically added at some point during the checkout process, unknown to us and the customer (the customer has no way of adding notes/comments on the frontend).

I have checked the MySQL database directly and the comments are being stored in the sales_flat_order.customer_note database field.

I have searched through all our custom extension files but did not find any extensions referencing the customer_note field, as my initial suspicion was that an extension may have introduced this functionality - but this does not appear to be the case.

How can we troubleshoot this and/or prevent it from happening?


texts: Block in reference root not loaded but loaded in reference header

texts:
Magento CE 1.9.4.5

I created a module and successfully had it loaded. The xml is below:
<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <reference name="header">
            <block type="core/template" name="mymodule.topbar" template="topbar/content.phtml"/>
        </reference>
    </default>
</layout>

As you can see, the content is the reference name="header" in topbar/content.phtml is loaded by calling $this->getChildHtml('mymodule.topbar') in header.phtml.
I wonder if I still need to load the topbar even when header is not used, so changed the xml to:
<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <reference name="root">
            <block type="core/template" name="mymodule.topbar" template="page/html/topbar.phtml"/>
        </reference>
    </default>
</layout>

I copied the content.phml file to app/design/frontend/mymodule/mytheme/template/page/html and renamed it to topbar.phtml. It suddenly doesn't load anymore and I can't see anything wrong.
Any one please give me some advice. Thanks in advance.


texts: Adding category attribute (select) via installer. Set defaut not working but get additional empty value

texts:
I'm trying to add a custom attribute to the category page. It will already show up but I only want to have the values Yes/No in it. Unfortunately there is always an empty, preselected value. So actually 3 values. I can't get rid of it! Can anyone point me in the right direction that only YES/No shows up? Preferably with "No" preselected. Thank you so much

<?php
    $installer = $this;
    $installer->startSetup();
    $attribute  = array(
    'label'             => 'Show in Parent Category',
    'type'              => 'int',
    'input'             => 'select',
    'default'            => 0,
    'sort_order'         => 2,
    'group'          => 'General Information',
    'backend'           => 'eav/entity_attribute_source_table',
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible'           => true,
    'required'          => false,
    'user_defined'      => true,
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'visible_on_front'  => false,
    'visible_in_advanced_search' => false,
    'unique'            => false,
    'option'             => array (
                            'values' =>
                                array (
                                    '1' => 'Yes',
                                    '0' => 'No'
                                )
                            )
    );
    $installer->addAttribute('catalog_category', 'show_in_parent_category', $attribute);
    $installer->endSetup();
?>


texts:
I have installed the cron job as proposed. Now I'm wondering if there are reasons when I should disable it temporarily, so that nothing gets in conflict. Is that necessary at all or is Magento able to dismiss cron jobs when needed?
Do you disable them at any time? During updates or reindexing or whatever?
If so, how do you do that? Do you evaluate the existence of the var/maintenance.flag file in your crontab for the maintenance mode?


texts: How come for a batch of newly imported products the URL structure is different than our normal configuration?

texts:
I imported some 34 simple products to our admin store, base site, via MageBees' Import/Export Products extension, as I often do. The problem is that their URLs are rendering as default/catalog/product/view/id/13578/s/24-round-granite-white-plastic-folding-table/category/990/ when all our products' permalinks are normally in the form of default/48-round-bi-fold-granite-white-plastic-folding-table.html.

This was a problem when they were first imported but unfortunately I have not an accurate log of the details of that scenario. They were since deleted and re-imported. I think it was because I had imported them to the main store and not the admin, so all the default values were different or something, and had something to do with the status setting in each view...

In both default and store views status = Enabled, although in store view it's also set to use the default view value. If disabled in either view, product is inaccessible in the frontend. When I in store view UNSET use_default status, at first it appeared to fix the issue and the URL structure reverted back to normal; so I applied this to all of them and for whatever Magical Mystery Magento reason (like 666 MMM) it fixed about half of them seemingly totally arbitrarily among the lot. Then, on ones resolved, I tried setting status = use_default[] and the URL stayed proper. So it didn't change back to the other/wrong structure/format.

To me this makes little sense and I'm at a loss as to what to try. I've tried clearing the cache. Any ideas?


texts:
Is there any way to add a button and column at the backend order view items renderer?
I have tried multiples solution but did not work.

sales_order_view

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body>
    <referenceBlock name="order_items">
        <arguments>
            <argument name="columns" xsi:type="array">
                <item name="inventory_source" xsi:type="string" translate="true">Source</item>
            </argument>
        </arguments>
        <referenceBlock name="default_order_items_renderer">
            <arguments>
                <argument name="columns" xsi:type="array">
                    <item name="inventory_source" xsi:type="string" translate="true">col-source</item>
                </argument>
            </arguments>
        </referenceBlock>

        <block class="Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn" name="inventory_source"
               template="Test_DropShipping::order/items/source.phtml" group="column"/>
    </referenceBlock>
</body>

phtml file:

<?= $block->escapeHtml(__('Link to Product')) ?>
<?php if ($_item = $block->getItem()): ?>
<div class="product-source">
    <?= $block->escapeHtml(__('Link to Product')) ?>
</div>


texts: I cant seem to write an Plugin for \Magento\ImportExport\Model\Import\AbstractSource

texts:
I am trying to write a plugin for

\Magento\ImportExport\Model\Import\AbstractSource::current

using

<type name="Magento\ImportExport\Model\Import\AbstractSource">
    <plugin name="firegento_extendedimport_trim_row_data" type="FireGento\ExtendedImport\Plugin\TrimRowData" />
</type>

I also tried

<type name="Magento\ImportExport\Model\Import\Source\Csv">
    <plugin name="firegento_extendedimport_trim_row_data" type="FireGento\ExtendedImport\Plugin\TrimRowData" />
</type>

But in the debugger the interceptor just does not seem to be generated.


texts: How to add “Maximum Qty Allowed in Shopping Cart” to only certain items

texts:
I know I can set a maximum number of items that can be in the shopping cart at one time... But is there a way to selectively set what is limited?

For example...
I want customers to be able to order as many of the "core product" as they want, but I would like to limit the amount of samples one can purchase per order.

So, is there a way to make it so that the limitation is not global but is isolated to a specific category?

Thanks!


texts:
Sysnopsis
I am trying to change a tab on the admin products page (grouped); However for some obscure reason I cannot get my module to work.  The problem seems to be my module is completely ignored.
Code
app/etc/modules/Vendor_Catalog.xml:
<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Catalog>
            <active>true</active>
            <codePool>local</codePool>
        </Vendor_Catalog>
    </modules>
</config>

Vendor/Catalog/etc/config.xml:
<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Catalog>
            <version>1.0.0</version>
        </Vendor_Catalog>
    </modules>
    <global>
        <blocks>
            <vendor_catalog>
                <class>Vendor_Catalog_Block</class>
            </vendor_catalog>
            <adminhtml>
                <rewrite>
                    <catalog_product_edit_tabs_grouped>Vendor_Catalog_Block_Adminhtml_Catalog_Product_Edit_Tabs_Grouped</catalog_product_edit_tabs_grouped>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

Vendor/Catalog/Block/Adminhtml/Catalog/Product/Edit/Tabs/Grouped.php:
<?php
class Vendor_Catalog_Block_Adminhtml_Catalog_Product_Edit_Tabs_Grouped
    extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs
{
}


texts: Sidebar disappears when I make the window smaller! New development, was working fine before!

texts:
I have been working on this site:

http://greenlivingaustralia.com.au/shop

I simply edited the default rwd template in Magento to suit my needs.

I used the Codnitive Sidebar Navigation Menu Professional extension to move my menu from the top to the left sidebar and got everything working beautifully.

The navigation was breaking down well when the window was resized, turning into a beautiful accordion.

Now, suddenly, the menu is disappearing when I resize the window smaller.

I haven't changed much since the breakdown except for a few things in the header, to my knowledge. I reverted those changes and something is still amiss.

Any ideas?


texts: Remove "Sign Out" link in header panel but keep "Sign Out" link in dropdown

texts:
how do I remove the "Sign Out" link from the header panel but still keep the "Sign Out" link in the drop down menu (Which contain "My Account" and "My Wish List" links) next to it?

If I put this code in my theme's default.xml <referenceBlock name="header.panel"> <referenceBlock name="authorization-link" remove="true"/> </referenceBlock>, the "Sign Out" link in drop down is removed but the "Sign Out" link in the panel is not, which is the opposite of what I'm trying to achieve.


texts: in magento 2 how can I redirect customer to bank payment url after placing the order?

texts:
I am creating payment method module which requires external redirect to bank for user to verify funds withdraw. After user verifies purchase, bank will redirect it to my store's controller.

I want to use redirectAfterPlaceOrder but, url itself is obtained in backend MyCompany\MyBank\Gateway\Http\Client\Client object and accessible only after sending request to bank. This oject is a client, for my payment method, which is declared in di.xml :

   <virtualType name="MyBankAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            ...
            <argument name="client" xsi:type="object">MyCompany\MyBank\Gateway\Http\Client\Client</argument>
            ...
        </arguments>
    </virtualType>

I tried to use ResultFactory to force redirect to bank url, but this was not successful. How can I redirect customer to banking url after placing the order ?


texts: Configurable checkouts based on store view

texts:
I'm working on Magento site with multiple stores. All stores use the same theme but now I need to use a different checkout for one of the stores. It would be something like having a three step checkout module for one store view and one step checkout for the others.

Can anyone advise on the best route to take in order to achieve this or offer any advice that seems relevant?


texts: How to change position of Ves Brand carousel in home page Magento2

texts:
I have Magento 2.2.3 and module Ves Brand.

When I add carousel with brands it appear under menu in top part of main destination. There is no settings to change it and is difficult to find reference name of block.

I wonder how to change position of this carousel.


texts: Moving a specific elemnt from block element

texts:
How do I move just the Sign In from header.panel to header content?

I have this snippet but is not the desired output

 <move element="top.links" destination="header-wrapper" before="minicart" as="links"/>


texts: I want to allow the invoice save action once the order is in processing state for this i have to add some logics inside the Magento\Sales\Controller\Adminhtml\Order\Invoice save file. please advice me


texts:
I am setting up a Magento store on Community 1.9
I am trying to configure USPS shipping. I can't figure out what I'm doing wrong - all I see when I do a test order is "Sorry, no quotes are available for this order at this time."

I'm attaching a screenshot of my configuration. The only thing I'm not sure about it "Packages request type" (what does this mean???) but everything else should be all set...any ideas for why this isn't working?


texts:
How can I delete the /index.php from the frontend URL's?
Thank you!


texts: Enable Ship Button Based on Order Status

texts:
When a customer placed an order , We will place order in processing state. After that QC team will pack the order when the QC is completed then they will change the order status to QC Passed .

Now i want to show "SHIP" button on QC Passed state only. For remaining order status it won't be show. How can i implement this?


texts: echo product description if the products belongs to specific category

texts:
On my category pages I want to display the product description under the product if it belongs to a specific category. This is what I've tried:

<?php
    $catdesc=true;
    $categoryId = $_product->getCategoryId();
    $category = Mage::getModel('catalog/product')->load($categoryId);
    if($category->getCatdesc()==428){
        $catdesc=true;
        break;
}
?>

<?php if($catdesc): ?>
    <?php echo $_product->getDescription(); ?>
<?php endif; ?>

It get's the product description alright, however for any product- whether it belongs to the specific category or not.
Any ideas what I'm doing wrong?


texts: Magento 2 - How To Display Cross Sell Products On Product Details Page (PDP)?

texts: I need to show cross sell products on pdp (Product Detail Page ) page , like currently related products shows , hows it possible ?


texts: Load Checkout comments in sales/order/print - basic module question

texts:
Short version: my question is how do I load all my checkout data in that pdf generator so that I can run functions like $order->getOnestepcheckoutCustomercomment()

Long version: I'm writing a module to insert One step checkout comments in sales/order/print (on success page, the print order pdf generator).

I've done it for the admin pdf generator and it works fine there by using

<models>
            <sales>
                <rewrite>
                    <order_pdf_invoice>Company_Module_Sales_Model_Order_Pdf_Invoice</order_pdf_invoice>
                </rewrite>
            </sales>
</models>

and the Invoice.php in the relevant directory structure:

class Company_Invoices_Sales_Model_Order_Pdf_Invoice extends Webshopapps_Invoicing_Sales_Model_Order_Pdf_Invoice{
//checkout functions here
}

Now I've been trying like this:

<helpers>
      <invoices>
          <class>Company_Invoices_Helper</class>
      </invoices>
    </helpers>

and in Data.php:

class Company_Invoices_Helper_Data extends Mage_Core_Helper_Abstract{
if( !$order->getOnestepcheckoutCustomercomment() ) { return; }

        $this->y -= 5;

        $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));

        $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));

        $page->setLineWidth(0.5);

 //etc.  all the checkout functions

}

Here I have to run some functions like the ones above, but I get the error "getOnestepcheckoutCustomercomment() call to a non object" so I'm guessing that I have to load all the checkout data and i'm unsure how.

In sales/order/print I am calling it like this <?php $helper = Mage::helper('invoices'); ?>

So, my question is how do I load OSC data in sales/order/print

Thanks!


texts: Memory gets full, using Magento in combination with Varnish Cache

texts:
We're using CentOS 6.8 with DirectAdmin, Apache 2.4.20, PHP 5.6.22, MySQL 5.6.29 and Magento 1.9.2.1 with all patches included (will be upgraded to 1.9.2.4 once we finished our new webshop but this might take some weeks).

I've installed Varnish and php-redis but don't think all the settings are set right. Memory gets up to 8 while theres 8gb memory inside the server. When I check top, I see many httpd's. Seems like these are staying too long or so. Not sure if this is caused by Varnish? Anyone got ideas how to fix this?


texts: Magento 2.2.3 - Get all categories in store programmatically

texts:
I'm trying to gather all categories in my store.

As a start I'm using the object manager.

I know it is bad practise to use the objectmanager directly, but after this I will convert it into a block class with dependency injection.

This is the code in my view to gather the categories:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$categoryFactory = $objectManager->create('Magento\Catalog\Helper\Category');
$categories = $categoryFactory->getStoreCategories(false,false,true);

When I dump $objectManager, categoryFactory or $categories in my view, the memory of my development server will fill up. After the server reaches the memory limit my browser will give this as a response ERR_EMPTY_RESPONSE.


texts: What are the differences and similarities between Magento plugin vs extension vs module?

texts: Please explain the differences and similarities amongst them with use cases


texts: How Set Manage Stock as no in the magento - Programmatically

texts:
How Set Manage Stock as no in the magento,
i have used this code but manage stock showing as yes

            $_product->setStockData(array(
                'manage_stock' => 0,
                'use_config_notify_stock_qty' => 0
            ));

but when use

            $_product->setStockData(array(
                'is_in_stock' => 1,
                'qty' => 9999,
                'manage_stock' => 0,
                'use_config_notify_stock_qty' => 0
            ));

the quantity and is_in_stock status has been update but manage stock not setting as no.

what is the problem?


texts:
I want to create an order using API in magento.

I have already create an api as following:
cart.create
cart_product.add
cart.totals

So quote is generated in magento when customer called API from android while product add to cart. Now next thing is to create an order of this quote.

Description More about query :
we place an order in magento by following way :

Add product to cart
Select shipping method (but here not because I am using downlodable product)
Select payment method
Place order

Now see how I maintain above steps between android app and magento

Customer add product to cart in application (service is called to magento this time and I am adding products to cart with method “cart.create”)
Customer select payment method Paypal. This time any service is not called but as we have paypal sdk,customer redirect to paypal from app to gateway.there he pay amount and come back to application.
Now when he come back to application,service is called. And on this call I have to create an order.

May be this is more easy to understand my query.

Here I am confused, how to create an order in Magento after success/canceled transaction response, sent from App to Magento.


texts:
i would like to pull from database list of purchased items that within their description there is a specific text

the list of the items should contain the price they were sold at the time.

Thanks!


texts: Magento 2 issue on category page and product page of "inventory_stock_1" table?

texts:
I am facing issue on product page and category page.

Can any one suggest or guide me on this ?


texts:
I'm trying to install SUPEE-9767 but it failed with the following return :

patching file app/code/core/Mage/Admin/Model/Session.php
Hunk #1 FAILED at 138.

1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Admin/Model/Session.php.rej

patching file app/code/core/Mage/Customer/Model/Session.php
Hunk #1 FAILED at 222.
Hunk #2 FAILED at 308.

2 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Customer/Model/Session.php.rej

I tried to replace those files with github one but it won't work either.

I also read about missing SUPEE-7405 but it was needed prior to Magento 1.9.2.4 (which is my release)

And I don't get debug message about saving rejects. Couldn't find these files...


texts: Magento 2 - Category Listing in Left sidebar

texts: How to show list of categories and child categories in the left side bar of the category page and some cms pages


texts:
Using Magento2 commercial theme, and this theme has Minicart closing on "hover". We want to change this to original Magento2 closing on click.

Tried everything nothing works:


texts: Category Manager Page in a Reload Loop Nginx

texts:
When I go to the categories admin page the the page keeps loading over and over again.

I use NGINX on ubuntu 14.04.  How do I fix?

I checked the server log and each iframe reload get a 200.

It keeps on reloading a div in an iframe in an endless loop.


texts: Error 404 for rjsResolver.js in adminhtml and frontend

texts:
I have a big problem with this file.

What I need is to recreate this file:

  /pub/static/adminhtml/Magento/backend/en_US/rjsResolver.js

What is problem: I have 404 when I enter backend or frontend for this one
particular file.

What I do:

Manually remove pub/static/frontend and pub/static/adminhtml

Run bin/magento setup:static-content:deploy in the Magento root directory

Run bin/magento cache:clean

I think this one file is from https://github.com/magento/magento2/blob/develop/app/code/Magento/Theme/view/base/requirejs-config.js#L13

I check and didn't help: https://github.com/magento/magento2/issues/2843
Checked: https://github.com/magento/magento2/issues/6409

My problem is that I cannot enable "Sign Static Files" in server (some Nginx issues so no possible right now)

Is there a solution to recreate it?
It was work before update from 2.0;

I have now: Magento 2.1.7
I deploy static-files, have developer mode, cache clean, do some other stuff and nothing work.


texts:
I tried updating the cart using JS and summary container is updating properly. But I want to update the quantity of the item. So basically I have added a custom button in checkout/cart page. When this button is click I add one product into the cart. Now this product is fix and the quantiity added per click is fix. Now everything is working just fine including the summary container. But I want to update the Quantity field in the form-cart container. But I don't know how to do that.

I found out that getTotalsAction contains the total that  want but I don't know how to retrieve this result. I'm thinking of looping through the result to update the quantity value. How can I do this?

Note: I don't want a page refresh.

Below is my code

define([
    'jquery',
    'Magento_Checkout/js/action/get-totals',
    'Magento_Checkout/js/model/cart/cache',
    'Magento_Checkout/js/model/cart/totals-processor/default',
    'Magento_Checkout/js/model/quote',
    'Magento_Customer/js/customer-data',
    'jquery/ui'
], function ($, getTotalsAction, cartCache, totalsProcessor, quote, customerData) {
'use strict';

 $.widget('mage.poundToCart', {
     _create: function () {
       this.processAddCart();
    },
    processAddCart: function(form) {
        formData = new FormData(form[0]);
        $.ajax({
            url: form.attr('action'),
            data: formData,
            type: 'post',
            dataType: 'json',
            cache: false,
            contentType: false,
            processData: false,
            success: function (res) {
              var deferred = $.Deferred();
              getTotalsAction([], deferred); // <--- I want to retrieve this value
              return false;
            }
       });
    }
 });

How can I do this?

I tried this link but this does not apply in my situation as there is no validate response that I get. So I just want to refresh the cart form page like the image below

So basically I want to update the quantity field since adding the product is done via Ajax


texts: Duplicated product show original description

texts:
I have Magento CE 1.9.2

I duplicate some product. Then edit description.
After that on page of duplicated product I see old descripion (of original product).

How can I change description of duplicated product?


texts: Malware in Miscellaneous Scripts section in General/ Design tab

texts:
OK so google informed me that my website had been compromised and had Malware so they were showing a warning to people coming to my website through Chrome.

I have found the Malware it looked something like this

<script>
var _0x7539=["\x6C\x6F\x63\x61\x74\x69\x6F...

It was in Miscellaneous Scripts section in General/ Design tab.

I have removed it but how do I prevent it from happening again, do the hackers have a back door? What do I do.

I thought I was doing everything right.

I have a CDN, blocked access to downloader, installed the patches and have strong passwords.

Can anyone else give me some more information?


texts: Is calling Mage::app() in a template file good or bad practice?

texts:
I want to get the store code in a phtml file.  I know I can get it with the below.

Mage::app()->getStore()->getCode()

But is this good or bad practice?  My guess is that it is not as Mage::app() is firing up the application again, which would be very heavy.  But I see it used a lot, so maybe I'm misunderstanding it?


texts: Unit tests custom module not executed - Magento 2

texts:
I have created a file under \Vendor\Module\Test\Unit\Block\Catalog\Product\ProductList\Toolbar.php

namespace Vendor\Module\Test\Unit\Block\Catalog\Product\ProductList;
class Toolbar extends \PHPUnit_Framework_TestCase
{
   public function setUp()
{
    $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
    // we want this to be a real Magento 2 object
    // complete with all it's dependencies
    // so we use the object manager to get it
    $this->block = $objectManager
        ->getObject('Vendor\Module\Test\Unit\Block\Catalog\Product\ProductList\Toolbar');
   }

   public function testgetAvailableOrders()
   { .... }
 }

My phpunit.xml is

 <testsuite name="Magento Unit Tests">
        <directory suffix="Test.php">../../../app/code/Vendor\Module /Test/Unit</directory>

Under magento 2 root, i ran

vendor/bin/phpunit -c dev/tests/unit/phpunit.xml app/code/Vendor\Module/Test/Unit/

I get "No tests executed"


texts: Magento related products disappears with item max qty in cart

texts:
In Magento we have set "Display Out of Stock Products" => "Yes"

On product pages, we have a "Related products" section (related.phml => if($this->getItems()->getSize()):)

However when Maximum Qty Allowed in Shopping Cart has been reached, the product disappears from the related products (as well as upsells).

Why is this and how can I display these products anyway?


texts:
I have little experience with websites. I built my own Wordpress site for my business, and that was a relative breeze with the multitude of tutorials and info out there. Not to mention Wordpress is built for people like me lol. By no means do I know php, html, etc, however I learn extremely fast and can pick things up quickly and easily. I just need some guides or tutorials to learn what I will need.

I would like to use a template and implement all of our products and handle the content of the site. Sort of how Wordpress works really lol. What will I need to do this? Is this just a bad idea? I want to be able to have a working site in ~2-3 months.

TL;dr
0 website building experience. Learn fast, want to build my own Magento2 site off a template.


texts: shipment rest API not working in Magento 2

texts:
Endpoint

POST http://<host>/rest/default/V1/order/3/ship

where 3 is the order id.

Headers

Content-Type application/json

Authorization Bearer <administrator token>

Request Body:

{
"items": [
{
"extensionAttributes": {},
"orderItemId": 96,

"qty": 1
}
],
"notify": true,
"appendComment": true,
"comment": {
"comment": "Tracking URl : www.tackingurl.com/id?123456789",
"isVisibleOnFront": 0
},
"tracks": [
{
"trackNumber": "1234567890",
"title": "SHIPPING",
"carrier_code": "shipping"
}
]
}

Response:

[2018-03-09 08:29:06] report.CRITICAL: ReflectionException: Class array does not exist in C:\xampp\htdocs\Local\vendor\magento\framework\Webapi\ServiceInputProcessor.php:149
Stack trace:
#0 C:\xampp\htdocs\Local\vendor\magento\framework\Webapi\ServiceInputProcessor.php(149): ReflectionClass->__construct('array')
#1 C:\xampp\htdocs\Local\vendor\magento\framework\Webapi\ServiceInputProcessor.php(319): Magento\Framework\Webapi\ServiceInputProcessor->_createFromArray('array', Array)
#2 C:\xampp\htdocs\Local\vendor\magento\framework\Webapi\ServiceInputProcessor.php(119): Magento\Framework\Webapi\ServiceInputProcessor->convertValue(Array, 'array[]')
#3 C:\xampp\htdocs\Local\app\code\Local\AuthAclOverride\Controller\Rest\InputParamsResolver.php(121): Magento\Framework\Webapi\ServiceInputProcessor->process('Magento\\Sales\\A...', 'execute', Array)
#4 C:\xampp\htdocs\Local\vendor\magento\module-webapi\Controller\Rest.php(299): Local\AuthAclOverride\Controller\Rest\InputParamsResolver->resolve()
#5 C:\xampp\htdocs\Local\vendor\magento\module-webapi\Controller\Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()
#6 C:\xampp\htdocs\Local\vendor\magento\framework\Interception\Interceptor.php(146): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#7 C:\xampp\htdocs\Local\var\generation\Magento\Webapi\Controller\Rest\Interceptor.php(39): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#8 C:\xampp\htdocs\Local\vendor\magento\framework\App\Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#9 C:\xampp\htdocs\Local\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#10 C:\xampp\htdocs\Local\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#11 {main}

Next Exception: Report ID: webapi-5aa245d25da78; Message: Class array does not exist in C:\xampp\htdocs\Local\vendor\magento\framework\Webapi\ErrorProcessor.php:195
Stack trace:
#0 C:\xampp\htdocs\Local\vendor\magento\framework\Webapi\ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(ReflectionException))
#1 C:\xampp\htdocs\Local\vendor\magento\module-webapi\Controller\Rest.php(219): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(ReflectionException))
#2 C:\xampp\htdocs\Local\vendor\magento\framework\Interception\Interceptor.php(146): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#3 C:\xampp\htdocs\Local\var\generation\Magento\Webapi\Controller\Rest\Interceptor.php(39): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#4 C:\xampp\htdocs\Local\vendor\magento\framework\App\Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#5 C:\xampp\htdocs\Local\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#6 C:\xampp\htdocs\Local\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#7 {main} [] []


texts: Is there any way to update QTY programmatically using front controller?

texts:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$product = $objectManager->get('Magento\Catalog\Model\Product')->load($id);

$productStockData = $this->stockRegistry->getStockItem($product->getId());

$productStockData->setData('is_in_stock', 0);

$productStockData->setData('qty', 0);

$productStockData->setData('manage_stock', 1);

$productStockData->save();

echo "<pre>";

print_r($productStockData->getData());

exit;

$product->save();

This code gives the result with correct qty in array print but not reflecting in database ..


texts: Managing Uploads on multiple EC2 frontends

texts:
I'm moving a Magento site to AWS, there will be 2 EC2 frontends in the new setups. I'm wondering if there are any standard approaches to managing things like the /var and /media directories so far as uploads?

As far as I know, the easiest way to handle this is to map those directories onto S3 buckets. Some applications also have in-built functionality to use S3, such that the aforementioned is not even necessary - but I'm guessing it would be too hard or even impossible to make a Magento extension to achieve the same effect?

Has anyone done this sort of thing before, and if so, what has been your approach? What are the pitfalls?

Thanks


texts: Magento 1: Redirect cache product image to default product image

texts:
How to redirect cache product image to default product image ?
Is it possible via .htaccess file

Redirect  [BASE_URL]/media/catalog/product/m/o/art.jpg  [BASE_URL]/media/catalog/product/cache/1/image/9df78eab78452d08d6e5fb8d27136e95/m/o/art.jpg


texts: Magento 2.1.9 : unable to access to storage root in wysiwug popup

texts:
Preconditions

Magento 2.1.9
Add image to block from admin

Steps to reproduce

Add image to block by wysiwyg files

Expected result

Wysiwyg popup with storage root and all files

Actual result

Wysiwyg popup = blank page
[![enter image description here][1]][1]

Can you please help me to find a solution for this issue, I thing there is a problem with treeJson ajax.


texts:
I am using Magento 2 and want to manage orders using REST API from a third party portal. I am facing two problems:

Paypal orders when placed go to status of Complete instead of
Processing and then i am unable to ship the order and add tracking
details. Shipping via API says that a Complete order cant not be
shipped.
All card payments have a status of Processing and once a card
payment order is shipped without tracking details i am unable to add
tracking details to the order.

can someone please help with above.

thanks


texts: Execute after plugin: how to know no error occurred?

texts:
I'd like to plug an after plugin to the admin controller saving attribute data (Magento\Catalog\Controller\Adminhtml\Product\Attribute\Save) but this plugin should be processed only if no error/exception occurred during controller execution.
Question is: how can I found this out since there's no public method for accessing redirection url with \Magento\Framework\Controller\Result\Redirect\Redirect\Redirect class ?
I thought this would be rather a common case with after plugin but I found no similar question across the web.


texts: Is there any way to restrict API methods in Magento2?

texts:
I refer:http://vinaikopp.com/2017/02/18/magento2_repositories_interfaces_and_webapi/
So apart from that any other way possible to restrict API and also is it possible to restrict few methods in API which is provided by Magento2?

Any help would be appreciated.

Thanks in advance..!


texts:
I am trying to display all my users first and last names and email addresses to practice pulling values from the database and joining tables.

I have been trying to dig through the code in app/code/core/Mage/Customer/Model to see how to select specific values from two different tables. I can see the data I want is stored in customer_entity_varchar and customer_entity and is linked by the entity_id column but can't find an example of how I could achieve my desired result.

I have been working on the assumption that collections are the way to do it and so far have this

$model = Mage::getResourceModel('customer/customer_collection');

var_dump($model->getData());

but this shows all the columns and I just want email so I tried this

$model = Mage::getResourceModel('customer/customer_collection');

foreach($model as $cust){
    echo '
' . $cust['email'] . '
';
}

but I'm sure a collection would be a better way of doing it. Also I still need to join customer_entity_varchar but I can't find which model I need to use.

Firstly, how do I select customer email and full name? Secondly, Where should I have been looking in the code to get this answer?

===========

One last attempt I made was

$model = Mage::getResourceModel('customer/customer_collection');
    $model->getSelect()
          ->join(Mage::getConfig()->getTablePrefix() . 'customer', 'main_table.entity_id = ' . Mage::getConfig()->getTablePrefix() . 'customer.entity_id', array('*'));

  var_dump($model->getData());

but got this SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magentostoretest.customer' doesn't exist


texts: Add Files/Images as custom option to existing Order

texts:
I am trying to attach a file / image to an existing order item as Option.

$order = Mage::getModel('sales/order')->load(863);
$predefinedOption = array(
'type' => 'image/tiff',
'title' => 'test',
'quote_path' => '\media\'.$image,
'order_path' => '\media\'.$image,
'fullpath' => Mage::getBaseDir() .'\'. $image,
'secret_key' => substr(md5(file_get_contents(Mage::getBaseDir() .'\'. $image)), 0, 20));

foreach($order->getAllItems() as $item){

   $oldOptions = unserialize($item->getProductOptions());
   $newOptions = array_push($oldOptions['options'],$predefinedOption);
   $item->setProductOptions(serialize($newOptions));
   $item->setCanSaveCustomOptions(true);
   $item->save();
   $order->save();
   break;
}

But it does`nt work. I can work with additional_options to add a text as option, but not the image itself. My target is to give the shop admin the possibility to download the file / image directly from the order grid.

may i need to add the option also to the quote item? Is there any solution to solve this problem?


texts: HTAccess login when enabling "Secure URLs in Admin"

texts:
I'm not a Magento guy, but I'm working on a Magento server for my company's customer. I have few questions as below:

Should I put HTTPS prefix instead of HTTP into the "Secure Base URL" field?
When I set the "Secure Base URL" to HTTPS then turn on "Use Secure URLs in Frontend" and "Use Secure URLs in Admin", it asks for a username and password before displaying the login dialog of admin page. I think it's some kinds of htaccess configured automatically by Magento when turning on the secure URL. But where is that authentication file? And is there any default login?

Magento version on this server is 1.14.

Thank you very much for helping me on this topic. I'm really dumb about this point :).


texts: I would like to display my website inside an iframe but it does not appear

texts:
i'm trying to display my website inside an iframe for a marketing campaign. But when i try to display my website it's appear blank.

This is the code


texts: Accessing singleton model properties in another controller

texts:
I have a controller from which I am setting a property of my model

$model = Mage::getSingleton('foo/bar');
$model->setData('name', 'somename');
echo $model->getData('name');

This outputs the value somename in the same Action

If i try to access this property in another controller Action it is not getting the value

$model = Mage::getSingleton('foo/bar');
echo $model->getData('name');

I have created a block for my second controller Action and trying to access same property. But its not getting the value.

Model class is as follows (please ignore class name)

class Z_Foo_Model_Bar extends Varien_Object
{
    protected $_cacheTag = true;
    protected $_name = true;

    public function _construct()
    {
        parent::_construct();

    }
    public function setName($val=''){
        $this->name = $val;

    }
    public function getName(){
        return $this->name;
    }

    public function getTest(){
        return 'one';
    }
}

I have a block method as follows

public function testsingle(){
        $model = Mage::getSingleton('foo/bar');
        echo $model->getTest();
        echo $model->getData('name');

    }

I am calling this method from my phtml file in second controller's block view file

$this->testsingle();

Still I am not getting the output 'somename' which is exptected

Reference here from SO Alan's answer


texts: How to set CURRENT_TIMESTAMP as a default value in Magento DDL

texts:
I am updating my table structure and everything work good, but default value for column created_at is 0000-00-00 00:00:00 again and again.

I want it to be equal to current time (CURRENT_TIMESTAMP);

Here is my current code:

$table->addColumn($tableBanners, 'created_at', [
    'type'     => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
    'nullable' => false,
    'comment'  => 'created_at',
    'default'  => 'CURRENT_TIMESTAMP'
]);


texts: Magento 2 configurable product cart item override issue

texts:
I have override two core checkout xml files for overriding default.phtml file in magento 2 as per the ref url -
Overriding template not working in Magento 2

But when I add configurable product to my cart, then its global attributes like color and size are not visible on cart page.

  app/code/XYZ/Checkout/view/frontend/layout/checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock class="Magento\Checkout\Block\Cart" name="checkout.cart.form">
            <block class="Magento\Framework\View\Element\RendererList" name="checkout.cart.item.renderers.override" as="renderer.list.custom"/>
            <arguments>
                <argument name="renderer_list_name" xsi:type="string">checkout.cart.item.renderers.override</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

  app/code/XYZ/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.cart.item.renderers.override">

            <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="XYZ_Checkout::cart/item/default.phtml" />

            <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="simple" template="XYZ_Checkout::cart/item/default.phtml" />

        </referenceBlock>
    </body>
</page>


texts: How to get order History of customer in Magento 2 API?

texts: Get list of all previous orders of the customer using Customer token in API.


texts: I have a big doubt in forming url for products. Currently url is formed by using the name attribute. I want to change this to sku_id(attribute)  of the products. For this where i need to change?


texts: Get product attribute block on category page: Magento 1.9

texts:
Here is the code display attribute block in PDP page,

    <?php
       echo $this->getLayout()->createBlock('catalog/product_view_attributes')
       ->setTemplate('catalog/product/view/attributes.phtml')
       ->toHtml();
   ?>

If i put same code in PLP page i am getting error, how can i display my attribute block in PLP page.


texts: Is there any limit on the number of product attributes which can be made is_filterable_in_search = 1 in Magento?

texts:
We are using Magento Enterprise 1.10 and SOLR as our catalog search engine.

We are facing one major issue in our live website is that whenever we start increasing number of search filterable attributes in our system, after certain limit catalog search breaks. It gives no search result.

I tried to look at the Magento exception logs it says:-

2014-12-16T21:07:53+00:00 ERR (3): exception 'Exception' with message '"400" Status: Bad Request' in /var/www/site/lib/Apache/Solr/Service.php:334

I tried to log the URL request made by Magento to SOLR during catalog search & it basically makes 3 request to SOLR and in the third request it has huge number of parameters in facet.field request URL.

I tried to copy the third request URL and hit it in browser but it does not gives any JSON response, it gives error HTTP Status code 400 Bad Request.

What could be the possible issue ?

Is there any limitation on no. of facet.field request made by Magento to SOLR

Is there some configuration changes is required on Magento or SOLR side to fix this issue ?


texts: Magento 2: Error during compilation Incompatible argument type

texts:
In Continue with

Magento 2: Error during compilation

I have below error while running

php bin/magento setup:di:compile

Errors during compilation:
        Custom\Module\Model\ResourceModel\Messages\Grid\Collection
                Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Magento\Store\Model\StoreManagerInterface; File:
D:/wamp/www/smint/magento/app/code/Custom/Module/Model/ResourceModel/Messages/Grid/Collection.php

        Custom\Module\Model\ResourceModel\Posts\Grid\Collection
                Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Magento\Store\Model\StoreManagerInterface; File:
D:/wamp/www/smint/magento/app/code/Custom/Module/Model/ResourceModel/Posts/Grid/Collection.php

Total Errors Count: 2

app\code\Custom\Module\Model\ResourceModel\Posts\Grid\Collection.php

namespace Custom\Module\Model\ResourceModel\Posts\Grid;

use Magento\Framework\Api\Search\SearchResultInterface;
use Magento\Framework\Search\AggregationInterface;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Custom\Module\Model\ResourceModel\Posts\Collection as PostsCollection;

/**
 * Collection for displaying grid of etrade posts
 */
class Collection extends PostsCollection implements SearchResultInterface
{
    public function __construct(
        \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\EntityManager\MetadataPool $metadataPool,
        $mainTable,
        $eventPrefix,
        $eventObject,
        $resourceModel,
        $model = 'Magento\Framework\View\Element\UiComponent\DataProvider\Document',
        $connection = null,
        \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
    ) {
        parent::__construct(
            $entityFactory,
            $logger,
            $fetchStrategy,
            $eventManager,
            $storeManager,
            $metadataPool,
            $connection,
            $resource
        );
        $this->_eventPrefix = $eventPrefix;
        $this->_eventObject = $eventObject;
        $this->_init($model, $resourceModel);
        $this->setMainTable($mainTable);
    }
}

app\code\Custom\Module\Model\ResourceModel\Posts\Collection.php

namespace Custom\Module\Model\ResourceModel\Posts;

use Custom\Module\Api\Data\PostsInterface;
use Custom\Module\Model\ResourceModel\AbstractCollection;

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection {

    protected $_idFieldName = 'posts_id';

    protected function _construct() {
        $this->_init(
                'Custom\Module\Model\Posts', 'Custom\Module\Model\ResourceModel\Posts');
    }

}

How to solve above complication errors?


texts: Magento 1.9.4.1. Get downloadable link for downloadable products with samples

texts:
The following piece of code is supposed to get the download link only for downloadable products with uploaded samples at the Magento backend.

if($_product->getTypeId() == 'downloadable') {
    /** @var Mage_Downloadable_Model_Resource_Sample_Collection $samples */
    $samples = Mage::getModel('downloadable/sample')->getCollection()->addProductToFilter($product_id);
    if ($samples) {
        $_myprodsamples = Mage::getModel('downloadable/link');
        $_mySampleCollection = $_myprodsamples->getCollection()->addProductToFilter($_product->getId());
        foreach ($_mySampleCollection as $_sample){
            $_samplelink = $this->getUrl('downloadable/download/linkSample/link_id/'.$_sample ->getId());
        }
    }
}

<?php if($_samplelink): ?>
  <a href="<?php echo $_samplelink ?>" class="button btn-cart piwik_download" target="_blank">Downnload
<?php else: ?>

However, all downloadable products are showing the download links, and this should only happen for downloadable products with uploaded samples at the backend.

Has anybody an idea of what is still going wrong?


texts: Install scripts: Creating tables vs. updating existing ones

texts:
have one question, recently I was developing one module with a lot of tables in DB, and concept was changing often, so was need to change existing tables in DB, and I noticed difference in table creating script and table upgrading. Here you go.
Look at creating table code below:

$table = $installer->getConnection()
    ->newTable($installer->getTable('module/table'))
    ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, 9, array(
        'nullable' => false,
        'primary' => true,
        'identity' => true,
        'auto_increment' => true
    )
);

the newTable() function returns instance of Varien_Db_Ddl_Table
And upgrading table script uses different way to add new column to existing table, take a look:

$installer->getConnection()
    ->addColumn($tableName, 'test', array(
        'nullable' => false,
        'length' => 9,
        'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
        'comment' => 'Test Field'
    )
)

these two addColumn functions are different and also they are methods of different classes, and they make me sad every time I need to change syntax.
So here is question, is there way to update existing table using instance of the Varien_Db_Ddl_Table class?


texts: Do we have any alternative server to configure mails instead of gmail using SMTP pro Magento?

texts:
I am looking for this alternative server since gmail SMTP server can send only 500 mails per day. What if number of customers are more than 500 per day? How to incorporate this situation?

There by I would like to know if there exists any solution to this problem.