Behold, the Rambam wrote this law regarding eruvei techumin, see there. And we could say that regarding eruvei chatzerot and shitufi mevaot where there are many people, and one said to a baker or a shopkeeper, "acquire for me with this ma'ah," and he acquired for everyone from his own—it is an eruv. For just as he acquired for everyone from his own, he also acquired for this person from his own. But the Tur wrote that even in such a case it is not effective; for even though he acquired for everyone from his own, nevertheless, since he took a ma'ah from him, his intention was by way of sale and not by way of acquisition, and he did not purchase, see there, and this is the approach of Rashi, see there. And the Tosafot there wrote further, that even if the baker intended to acquire for him from his own, it is not effective, since he gave the ma'ah and intended only that he should purchase bread for him, and the purchase is nothing, see there. And the Rosh rejected this, for since his desire is for the eruv, why would he not be satisfied in such a case? And the Tur and the Shulchan Aruch ruled according to the opinion of the Rosh. And the reasoning of the Tosafot is also understandable, for it is more pleasing to him to perform the mitzvah with his own money and not that another should acquire it for him (Taz, subsection 4). And the Rosh holds that certainly one could say this reasoning, but since with his own money he cannot acquire without meshikhah, it is obvious that it is better for him that there be an eruv and that it not be with his own money, than that he should have no eruv at all. (See Magen Avraham, subsection 1, who raised a difficulty from Choshen Mishpat siman 199, that wine for kiddush is acquired with money alone because it is a matter of a mitzvah. And why should one not also acquire with money alone for an eruv? See there. And in truth, we cited there in Choshen Mishpat section 5 that there are those who cast doubt on this, see there. However, even without this it works out well, for in truth Rabbi Eliezer and the Sages disagreed in the Mishnah; for Rabbi Eliezer holds that for the sake of the mitzvah of eruv one acquires with money alone. And the Sages disagree with him and hold that this is not such a great mitzvah that for its sake we should nullify the enactment of the Sages who enacted meshikhah, for in what way is the enactment of eruv stronger than the enactment of meshikhah? And they did not nullify this enactment except for a Torah matter, such as during the four periods where the joy of the festival is from the Torah, and similarly kiddush is essentially from the Torah, and reflect on this.)
והנה הרמב"ם כתב דין זה בעירובי תחומין ע"ש. ונוכל לומר דבעירובי חצרות ושיתופי מבואות שיש רבים, ואמר לנחתום ולחנוני 'זכה לי במעה זו', והוא זיכה לכולם משלו - הוי עירוב, דכשם דלכולם זיכה משלו - אף לזה זיכה משלו. אבל הטור כתב דגם בכהני גווני לא מהני, דאף על גב דלכולם זיכה משלו, מכל מקום כיון שממנו נטל מעה - היתה כונתו על דרך מכירה ולא על דרך זיכוי, ולא קנה ע"ש וזהו שיטת רש"י ע"ש. והתוספות שם כתבו עוד, דאפילו אם הנחתום כיון לזכות אותו משלו - אינו מועיל, כיון שהוא נתן המעה וכיון רק שיקנה לו פת, והקנין אינו כלום ע"ש. והרא"ש דחה זה, דכיון שרצונו בעירוב - אמאי לא יתרצה בכהני גווני. והטור והש"ע פסקו כדעת הרא"ש, וסברת התוספות גם כן ניחא, דניחא ליה יותר לעשות המצוה בממונו ולא שאחר יזכיהו. (ט"ז סק"ד) והרא"ש סובר דודאי יש לומר סברא זו, אבל כיון דבממונו אינו יכול לזכות בלא משיכה - פשיטא שטוב לו יותר שיהיה עירוב ושלא יהיה בממונו, משלא יהיה לו עירוב כלל. (עיין מג"א סק"א שהקשה מחושן משפט סימן קצ"ט, דיין לקידוש קונה במעות בלבד, משום דהוי דבר מצוה. ולמה לא יקנה גם בעירוב במעות בלבד, ע"ש, ובאמת הבאנו שם בחושן משפט סעיף ה' שיש מפקפקים בזה ע"ש. אמנם גם בלאו הכי אתי שפיר, דהא באמת נחלקו במשנה ר"א וחכמים, דר"א סבירא ליה דבשביל מצות עירוב קנה במעות בלבד. וחכמים פליגי עליה, וסבירא ליה דאין זו מצוה כל כך, שבשבילה נבטל תקנת החכמים שתקנו משיכה, דמאי אולמא תקנת עירוב מתקנת משיכה. ולא בטלו תקנה זו, אלא בשביל ענין של תורה כמו בד' פרקים, ששמחת יום טוב דאורייתא, וכן קידוש עיקרו דאורייתא ודו"ק)